New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update package.json to fix deprecation of "./" #1461
Conversation
When executing 'ng build --prod' on Angular: Generating browser application bundles (phase: building)...(node:1188) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at {{PROYECT_PATH}}\node_modules\css-loader\node_modules\postcss\package.json. Update this package.json to use a subpath pattern like "./*". (Use `node --trace-deprecation ...` to show where the warning was created)
Merge this to fix the deprecation on new apps please! |
This fix does not work on Node.js <= 14. See 8.1.5 and 8.1.6 releases. Can you give me a way to reproduce the problem? I do not see the warning in Node.js 15. Post a way to reproduce to this issue. |
Angular 11 + Node v15 |
Can you create GitHub project when I can reproduce the warning? |
Here is a repo where the warning occurs. I use yarn package manager. |
I can’t see this warning on Linux with the latest Node.js 15. state-hooks/state-hooks
➜ node -v
v15.3.0
state-hooks/state-hooks
➜ yarn build
yarn run v1.22.10
$ react-scripts build
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
41.74 KB build/static/js/2.13fac87d.chunk.js
1.4 KB build/static/js/3.e8d53c0a.chunk.js
1.17 KB build/static/js/runtime-main.d5304bec.js
725 B build/static/js/main.955628b8.chunk.js
546 B build/static/css/main.ab7136cd.chunk.css
The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
You may serve it with a static server:
yarn global add serve
serve -s build
Find out more about deployment here:
https://cra.link/deployment
Done in 6.10s.
|
System information Edition: Windows 10 Home Single Language
|
Both Node.js 15.3 and 15.2.1 have the same output on Linux:
Maybe this error happens only on Windows? @joypoddar can you open {
"name": "postcss",
"version": "8.1.10",
"description": "Tool for transforming styles with JS plugins",
"engines": {
"node": "^10 || ^12 || >=14"
},
"exports": {
".": {
"require": "./lib/postcss.js",
"import": "./lib/postcss.mjs",
"types": "./lib/postcss.d.ts"
"./": "./",
+ "./*": "./*"
}, And then check the warning again. |
I made the suggested change in the "exports": {
".": {
"require": "./lib/postcss.js",
"import": "./lib/postcss.mjs",
"types": "./lib/postcss.d.ts"
},
"./": "./",
"./*": "./*"
}, Error
Note |
I know I'm a couple of months late but here is what i did in the postcss json file: |
When executing 'ng build --prod' on Angular:
Generating browser application bundles (phase: building)...(node:1188) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at {{PROYECT_PATH}}\node_modules\css-loader\node_modules\postcss\package.json.
Update this package.json to use a subpath pattern like "./*".
(Use
node --trace-deprecation ...
to show where the warning was created)