-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Server doesn't work with esm
package
#455
Comments
esm
packageesm
package
According to the nodejs documentation
PS: using PPS: All |
Should I update the code to require by default unless a
Obviously that name is terrible :P Also.. this would result in a potentially breaking change? Thats what I was trying to avoid |
Look like |
Okay, I can switch it to using a simple require. Should I add |
@theKashey PR opened which changes Let me know if I can change/improve anything else, happy to help. Thanks for making this package :) |
this improves support with 'esm' package Closes #455
🐛 Bug Report
When using
@loadable/server
with theesm
package, when you instantiate theChunkExtractor
you will get the following error:To Reproduce
Steps to reproduce the behavior:
Run the following with a valid
nodeStats
path:Expected behavior
ChunkExtractor successfully loads and uses the required nodeStats file path.
The fix (IMO)
You're currently using
module.require
. If I tweak this line to read as follows:More about why
module.require
is not defined here.I am more than happy to open a PR for this, but unsure if this is the solution you want to take. Please let me know!
Run
npx envinfo --system --binaries --npmPackages @loadable/component,@loadable/server,@loadable/webpack-plugin,@loadable/babel-plugin --markdown --clipboard
Paste the results here:
The text was updated successfully, but these errors were encountered: