Static GitHub Issues

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

prev: Nested page component not re-rendered when data is updated
next: Transition single element

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?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1574">#c1574</a>)</em></sub></div>