Skip to content
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

do not define a valid './colors' target #32

Closed
iceycc opened this issue Jun 20, 2020 · 6 comments
Closed

do not define a valid './colors' target #32

iceycc opened this issue Jun 20, 2020 · 6 comments

Comments

@iceycc
Copy link

iceycc commented Jun 20, 2020

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Loading PostCSS Plugin failed: Package exports for '/xxxx/node_modules/kleur' do not define a valid './colors' target

@lukeed
Copy link
Owner

lukeed commented Jun 20, 2020

What is your Node.js version?

Anything between >= 13.0 and < 13.7 had an earlier version of exports map support that has since been removed and deprecated.

@iceycc

This comment has been minimized.

@lukeed

This comment has been minimized.

@flavienbwk

This comment has been minimized.

@flavienbwk
Copy link

It is perfectly working with version 14.4.0. I had version 13.0.x

@lukeed
Copy link
Owner

lukeed commented Jun 21, 2020

TLDR;
If you are using Node 13.0 - 13.6, you're going to have a bad time. These versions included early, experimental versions of native ESM support that are not compatible with the finalized behaviors found within 12.x, >13.7, and 14.x.

kleur and kleur/colors work in all versions of Node that are not within the 13.0 - 13.6 range.
These versions had experimental and/or incomplete exports map support, which are unable to parse and resolve the new fields correctly.

Put differently, any module that supports conditional ESM (this includes kleur) will fail to load with Node.js 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, and 13.6. They will all resume working with 13.7 and later.

Now, kleur specifically, will still work for Node >= 6 and Node >= 13.7. Only the early 13.x versions will fail.

That said, odd-numbered Node.js releases are always experimental.
Once the next even version is released (14 in this case), you should always use it.
In this case, all of Node 13.x will be marked as "End of Life" comes July 2020.


Marking this as closed, but will pin the issue for easier visibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants