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

SystemJS export map leads to a warning in newer Node versions #2346

Closed
lemonmade opened this issue Jun 25, 2021 · 2 comments
Closed

SystemJS export map leads to a warning in newer Node versions #2346

lemonmade opened this issue Jun 25, 2021 · 2 comments

Comments

@lemonmade
Copy link

Demonstration

I couldn't figure out how to show this in Codesandbox, but you can make this issue happen by running node locally with a newer version of Node (I can't run v15, but I believe it happens there, in addition to v16, where I experienced the issue). Make sure systemjs is installed locally, run node to get into the interactive prompt, and type:

require('systemjs/dist/s.js') // import() and require.resolve() also trigger the warning

You will see this message printed to the console:

(node:91715) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at <PROJECT>/node_modules/systemjs/package.json imported from <PROJECT>/repl.
Update this package.json to use a subpath pattern like "./dist/*".
(Use `node --trace-deprecation ...` to show where the warning was created)

Expected Behavior

There are no warnings when attempting to resolve SystemJS in Node.

Actual Behavior

There are for some versions of node :) From perusing other projects with similar issues, it seems that the "fix" is to update this export entry: https://github.com/systemjs/systemjs/blob/main/package.json#L12 to instead use a * to represent that you can reach into any files on that subpath:

{
  "./dist/*": "./dist/*"
}

Though, based on issues like postcss/postcss#1455, it appears that this might not allow these specifiers to work with some versions of Node 12. It's not the end of the world for me to experience this error, but would love not to have it if possible.

Thanks for all the amazing work on SystemJS!

@joeldenning
Copy link
Collaborator

This was fixed in #2347

@lemonmade
Copy link
Author

Thanks so much, worked like a charm for me!

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

2 participants