Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Reference error when used with webpack-dev-server #70

Open
localjo opened this issue Oct 31, 2019 · 0 comments
Open

Reference error when used with webpack-dev-server #70

localjo opened this issue Oct 31, 2019 · 0 comments

Comments

@localjo
Copy link

localjo commented Oct 31, 2019

I'm using script-loader to load some legacy scripts into my app. Everything works fine when I build with webpack, but when I build with webpack-dev-server instead (to enable hot reloading of other, non-legacy scripts in my project), all of my bundles that use script-loader throw an error in the browser;

[Script Loader] ReferenceError: require is not defined
...
at Object../node_modules/webpack-dev-server/client/index.js?http://localhost:8080 (myScriptLoaderBundle.js:338)

Oddly, the legacy scripts seem to still be loading in the browser, and the hot reloading of other resources works. But I'm trying to figure out what causes the error, and see if there's anything I can do to avoid it. I thought it might be related to liady/webpack-node-externals#17 but it doesn't look like script-loader uses webpack-node-externals.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant