Postcss: DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at G:\SNWS\sn-micro-front-web-project-template\node_modules\postcss\package.json.

17

This is not a error!!!

operating system: Windows 10,
node: 15.1.0,
npm: 6.14.8,
webpack: 5.4.0,
postcss: 8.1.4

This is only a warning issued by "nodejs". It is recommended to make corrections according to the warning, because some writing methods are not recommended.

image

LP1994 picture LP1994  ·  5 Nov 2020

Most helpful comment

4
ShenHongFei picture ShenHongFei  ·  5 Nov 2020

All comments

4
ShenHongFei picture ShenHongFei  ·  5 Nov 2020
0

The fix was released in 8.1.5.

ai picture ai  ·  5 Nov 2020
0

@ShenHongFei just replacing ././* cause an issue in Node.js 12.

Can we fix this warning by adding ./ and ./* together in package.json→exports?

ai picture ai  ·  5 Nov 2020
0

@ShenHongFei just replacing ././* cause an issue in Node.js 12.

Can we fix this warning by adding ./ and ./* together in package.json→exports?

Yes, that works.

ShenHongFei picture ShenHongFei  ·  6 Nov 2020
0

How I can see this warning?

ai picture ai  ·  6 Nov 2020
0

@LP1994 what do I need to call to see this warning?

ai picture ai  ·  8 Nov 2020
0

@LP1994 what do I need to call to see this warning?

These warnings appear only after upgrading to the following versions:
"postcss": "8.1.6",
"webpack": "5.4.0",
"npm": "6.14.8",
"node": "15.1.0",
operating system: Windows 10

LP1994 picture LP1994  ·  9 Nov 2020
0
ai picture ai  ·  10 Nov 2020
0

Nope, this way again kills Node.js 15 in CommonJS.

Can you create a small test repo?

ai picture ai  ·  10 Nov 2020
0

Nope, this way again kills Node.js 15 in CommonJS.

Can you create a small test repo?
Later, I'll try.

LP1994 picture LP1994  ·  10 Nov 2020
0

Hello. I have DeprecationWarning

(node:29624) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at D:jsprojectwebnode_modulescss-loadernode_modulespostcsspackage.json.
Update this package.json to use a subpath pattern like "./*".
webpack built bb7b669f975520d3919d in 8025ms
i 「wdm」: Hash: bb7b669f975520d3919d
Version: webpack 4.44.2

borodadada picture borodadada  ·  14 Dec 2020
0

I too have a deprecation warning, using postcss 8.2.1
nodejs 15.4
nextjs v 10.03

$ yarn dev
yarn run v1.22.5
$ next -p 3434
Loaded env from C:\Users\Anthr\drisdell-consulting-services\.env.local
Loaded env from C:\Users\Anthr\drisdell-consulting-services\.env
(node:12964) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\Users\Anthr\drisdell-consulting-services\node_modules\next\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)
ready - started server on http://localhost:3434
(node:12964) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\Users\Anthr\drisdell-consulting-services\node_modules\postcss\package.json.
Update this package.json to use a subpath pattern like "./*".
DopamineDriven picture DopamineDriven  ·  18 Dec 2020
0

The current "solution" by changing "./": "./" to "./*": "./*" (or adding "./*": "./*") did remove the warning, but it breaks the program on certain functionality.

However, if I reading this correctly, according to:
https://nodejs.org/api/packages.html#packages_subpath_exports

shouldn't the change be "./*": "./*.js" ?
I have tried it and it works..but of course, need a more thorough test,

Here is a small repository to reproduce the current warning (pending the solution)
https://github.com/ozbigcat/postcss-1455-deprecation-warning

My environment:
Windows 10
Node 15.3.0
npm 7.1.0
autoprefixer 10.1.0
postcss 8.2.1
postcss-cli 8.3.1
tailwindcss 2.0.2

ozbigcat picture ozbigcat  ·  28 Dec 2020
0

Uh, just found a case where "./*": "./*.js" also did not work.
In this case, it tries to look for a 'package.json.js' which is not valid name... happy to go back to the warning... :-(

ozbigcat picture ozbigcat  ·  28 Dec 2020
1

Having this problem. Also using tailwind, postcss, autoprefixer and gulp. No idea how to solve it.

Is this an error in one of the packages I'm using? It's only a warning at this point so I'm not terribly concerned but I am confused at the error message.

JR2Media picture JR2Media  ·  29 Dec 2020
0

Hello, I was wondering if someone got a solution for that issue, i am having the same issue and replacing with "./*" only breaks other postcss imports in the lib directory (updating to vers. 8.0.0 did not resolve the issue :/)

Edit: I was using node.js version 15.5.1

Colorin09 picture Colorin09  ·  10 Jan 2021
0

I'm facing the same warning. I'm on node 15.5.1 with postcss 8.2.4

davidnjohansson picture davidnjohansson  ·  11 Jan 2021
2

I managed to fix the problem by downgrading to node.js 14.15.1, maybe it will work for you,
I couldn't find exactly what was the error, updating autowriter and postcss libraries did not work for my case:/

Colorin09 picture Colorin09  ·  11 Jan 2021
0

well, i'm getting this warning too, it's coming from node but it's related to postcss
node 15.
postcss 8.2.2
tailwind 2.0
Windows 10.

leandroruel picture leandroruel  ·  12 Jan 2021
0

Getting the same error as those commenting the last few days.
node 15.
postcss 8.2.2
tailwind 2.0
Windows 10.

JCGithu picture JCGithu  ·  13 Jan 2021
0

We do not need more reproduction cases. We need some solution, which will work on all Node.js. Adding ./* breaking old Node.js versions.

ai picture ai  ·  13 Jan 2021
0
duckness picture duckness  ·  14 Jan 2021
1

Seems like the problem was fixed in Node.js

ai picture ai  ·  14 Jan 2021
1

Can confirm I'm not running into the issue after updating to 15.6.0

duckness picture duckness  ·  15 Jan 2021
0

upgrading nodejs to v15.8.0 fixed the warnings for me

omostan picture omostan  ·  5 Feb 2021