-
-
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
@loadable/webpack-plugin hangs in production mode #179
Comments
Hello @tadeuszwojcik, I am sorry I don't have the time to dive in right now. I added "Help Wanted" flag, so if someone could help it would be nice! |
@neoziro thanks for quick reply, fully understand. I think current webpack plugin logic is a little bit incorrect (introduced when adding |
@tadeuszwojcik yes you are right, the logic is a bit incorrect. I think we should not accept an absolute path. Webpack has an output path and we should respect it. So I think the best thing would be to warn if an absolute path is used and to remove that logic (https://github.com/smooth-code/loadable-components/blob/master/packages/webpack-plugin/src/index.js#L64). What do you think? |
I believe absolute path is actually required here. At least once I wrote this it was needed for webpack dev server to actually output file. |
Thanks to help me to find the root cause of this hanging issue. :-) Using relative path solved my issue. |
🐛 Bug Report
Hi,
I'm trying to use
loadable
with setup similar to razzle one (two webpacks running, client and server), it looks promising, but have an issue with running it in production mode (it hangs the webpack build).I've just cloned the repo and it seems that razzle example perfectly reproduces it.
To Reproduce
In
examples/razzle
runyarn build
command.Expected behavior
Should finish the build successfully.
I did some digging, and it happens only when adding
filename
option in plugin that is set to absolute path (https://github.com/smooth-code/loadable-components/blob/master/examples/razzle/razzle.config.js#L11) . If nofilename
is set then it doesn't hang (but still fails as server side code does not find the file).I'm not really faimilar with webpack plugins, but if I remove code that adds the file to the compiler assets it seems to be fixing the issue (removed https://github.com/smooth-code/loadable-components/blob/master/packages/webpack-plugin/src/index.js#L25) . I know it may not be the best option.
What would love to have is that
LoadablePlugin
would work in production mode given (writeToDisk and filename path options - path that is resolved).Love the lib so far btw - especially preload/prefetch feature!.
Thanks!
The text was updated successfully, but these errors were encountered: