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

Warning 2.1.0: Critical dependency: require function is used in a way #15

Open
ivankravets opened this issue Oct 25, 2019 · 4 comments · May be fixed by #17
Open

Warning 2.1.0: Critical dependency: require function is used in a way #15

ivankravets opened this issue Oct 25, 2019 · 4 comments · May be fixed by #17

Comments

@ivankravets
Copy link

Webpack:

WARNING in ./node_modules/jsonrpc-lite/jsonrpc.js 16:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@antongolub
Copy link
Contributor

Afair, it's an old side effect of tsc umd packing. There're some ideas on how to deal with it:

  • Try to produce bundle with parcel, rollup or smth similar. Maybe these tools handles this case better.
  • Publish separate packages for each runtime: jsonrpc-lite-node, json-rpc-browser
  • Publish a single package with several entry points inside same as above: lib/node, lib/browser and lib/umd aliased to package.json main

@ivankravets
Copy link
Author

I've just rolled back to 2.0.7. It works well. Thanks!

@antongolub
Copy link
Contributor

@ivankravets Hold on.

I've already repacked the lib with microbunde.
Could you verify the fix? Just replace node_modules/jsonrpc-lite witn inners from microbundle branch.

antongolub added a commit to antongolub/jsonrpc-lite that referenced this issue Oct 28, 2019
@ivankravets
Copy link
Author

It builds without warnings. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants