Код: Выделить всё
20:21:42 assets.1 | [my_app] ▲ [WARNING] The CommonJS "module" variable is treated as a global variable in an ECMAScript module and may not work as expected [commonjs-variable-in-esm]
20:21:42 assets.1 | [my_app]
20:21:42 assets.1 | [my_app] app/assets/js/jquery.min.js:2:85:
20:21:42 assets.1 | [my_app] 2 │ ...ject"==typeof module.exports?module.exports=e.document?t(e,!0):f...
20:21:42 assets.1 | [my_app] ╵ ~~~~~~
20:21:42 assets.1 | [my_app]
20:21:42 assets.1 | [my_app] This file is considered to be an ECMAScript module because the enclosing "package.json" file sets the type of this file to "module":
20:21:42 assets.1 | [my_app]
20:21:42 assets.1 | [my_app] package.json:4:10:
20:21:42 assets.1 | [my_app] 4 │ "type": "module",
20:21:42 assets.1 | [my_app] ╵ ~~~~~~~~
20:21:42 assets.1 | [my_app]
20:21:42 assets.1 | [my_app] Node's package format requires that CommonJS files in a "type": "module" package use the ".cjs" file extension.
20:21:42 assets.1 | [my_app]
npm версия: 9.2.0
Что это значит и как избавиться от предупреждений?
Код: Выделить всё
{
"name": "my_app",
"private": true,
"type": "module",
"dependencies": {
"esbuild-sass-plugin": "^3.3.1",
"hanami-assets": "^2.2.1"
}
}
Код: Выделить всё
import "../css/app.css";
import "./jquery.min.js"
import "./test.js"
Подробнее здесь: https://stackoverflow.com/questions/796 ... ery-min-js
Мобильная версия