-
Notifications
You must be signed in to change notification settings - Fork 61
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
Uncaught ReferenceError: require is not defined #17
Comments
@akshaybabajob can you please share your webpack config? |
var webpack = require('webpack'); var commonPlugins = [ var commonConfig = { postcss: [ }; var clientConfig = { var serverConfig = { // Default config // Server. ]; // Client. ]; var webpackMerge = require('webpack-merge'); // Server //TODO : Test add this test cases file function includeClientPackages(packages) { function root(args) { |
I have the same issue, any updates? |
@ericraio Can you share the node stack trace for this exception? |
Same issue. This is targeting the browser. Config:
|
Notice that webpack-node-externals is meant mainly for excluding node modules when building for a library for Node. When running the code in the browser, there is no builtin There are 2 ways to solve the issue:
|
Same issue and @liady didn't solve it |
@FakhruddinAbdi Are you running your bundle in the browser? |
i can't solve "require is not defined" !!!!!!!! |
Have same :
|
@anlexN can you solve it? |
now , i give up this issue. it is a webpack bug. |
@anlexN ok,thanks. |
Any update? I am also getting the same issue |
I had rules for script-loader in my webpack.config.js {test: /.js$/, Removing this from webpack.config.js rmoved the error. |
Still having the same issue. Any solution for this one? |
Having the same issue. @liady |
Same here. @liady |
This tool is not meant for webpack projects that run in the browser. The author cannot help any of you because you are using this library in the wrong environment. |
I think we must update webpack version |
I have the same issue, any updates? My config webpack
|
@thucng I'm not sure why, but you can probably resolve it by removing |
As per @liady's comment I solved my problem by removing the use of |
I have the same problem. Nobody can solve it? |
|
Thanks, it works for me!! |
Change the
|
|
I was able to resolve is sort of issue with webpack:
Full disclosure I have not tried it with this package. |
I get this error when I run Not sure if that helps. |
adding that #2 worked for me, im writing a web app but another system was doing the webpack bundling for me, adding |
My issue solved by removing |
@liady, are there any plans to support something like |
@iorrah Thank you for your question! |
@liady, thank you for your answer. My use case is: when using webpack-node-externals to generate separated bundles (codebase and vendors), something causes loaders as Babel to stop working -- I mean, it's a node_module after all, right? A I want to create a webpack bundle containing only my codebase (which is a massive react app), and afterwards an individual vendors bundle containing only my vendors. Errors showing up on Chrome console:
|
when i un comment externals: [webpackNodeExternals()], it is working but this plugin is not working .. anyone help .. const path = require("path"); const devMode = process.env.NODE_ENV !== "production"; module.exports = { |
I just ran into this issue due to having "type": "module" in my package.json. Removing that and changing my filetypes from ".js" to ".mjs" seemed to fix it. |
I have the same error! bundle.js:1707 Uncaught ReferenceError: require is not defined |
When I add this to my commonconfig in webpack, it throws this error. I can't understand why is it occurring or how to solve this. Any help will be appreciated.
The text was updated successfully, but these errors were encountered: