jsonrpc-lite icon indicating copy to clipboard operation
jsonrpc-lite copied to clipboard

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

Open ivankravets opened this issue 6 years ago • 4 comments

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

ivankravets avatar Oct 25 '19 10:10 ivankravets

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

antongolub avatar Oct 28 '19 20:10 antongolub

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

ivankravets avatar Oct 28 '19 20:10 ivankravets

@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 avatar Oct 28 '19 20:10 antongolub

It builds without warnings. Thanks!

ivankravets avatar Oct 29 '19 12:10 ivankravets