Home

Issue: 1753

Build and generate command results to "require is not defined" error

[issue link]

Hi,

I’m trying to deploy my project by issuing nuxt build command. However, “require is not defined” error shows up in the browser. I can’t seem to track the source of the error. This also happens using nuxt generate . Weirdly, my application works fine in dev server.

Screenshot below shows the error in the browser:
image

Here are my dependencies:
“dependencies”: {
“axios”: “^0.16.2”,
“nuxt”: “^1.0.0-rc11”,
“uiv”: “^0.11.9”,
“vue-awesome”: “^2.3.3”
},
“devDependencies”: {
“babel-eslint”: “^7.2.3”,
“eslint”: “^4.3.0”,
“eslint-config-standard”: “^10.2.1”,
“eslint-loader”: “^1.9.0”,
“eslint-plugin-html”: “^3.1.1”,
“eslint-plugin-import”: “^2.7.0”,
“eslint-plugin-node”: “^5.1.1”,
“eslint-plugin-promise”: “^3.5.0”,
“eslint-plugin-standard”: “^3.0.1”
}

What could be the cause of this error?

This question is available on Nuxt.js community (#c1574)