question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When deploying to production setting NODE_ENV=production I get Cannot GET /

This only happens on production mode, why?

LOGS:

ERROR  Failed to compile with 2 errors                                                                                                             01:35:53

error  in ./src/App.vue

Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example
   at Object.module.exports.pitch (/Users/victor/projects/cryptolancer-io/code/frontend-cryptolancer-io/node_modules/extract-text-webpack-plugin/loader.js:25:9)

@ ./src/App.vue 2:2-371
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js

error  in ./src/components/Hello.vue

Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example
   at Object.module.exports.pitch (/Users/victor/projects/cryptolancer-io/code/frontend-cryptolancer-io/node_modules/extract-text-webpack-plugin/loader.js:25:9)

@ ./src/components/Hello.vue 2:2-381
@ ./src/router/index.js
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LinusBorgcommented, Dec 23, 2017

Oh, I usually use http-server when I want to quickly serve the built files locally.

0reactions
mymtwcommented, Dec 23, 2017

I changed my scripts, for production, now I’m running it with command start:

  "scripts": {
    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "start": "node server.js",
    "lint": "eslint --ext .js,.vue src",
    "build": "node build/build.js --prod"
  },

and in server.js:

app.use(express.static(__dirname + '/dist'))

// handle every other route with index.html, which will contain
// a script tag to your application's JavaScript file(s).
app.get('*', function (req, res) {
  res.sendFile(path.resolve(__dirname, 'dist', 'index.html'))
})

Everything ok now. Simply added node.js for testing that production build works, because I don’t want to install nginx locally or anything other.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Production Mode
Artist Collaboration, Geometric Lines, Ethical Manufacture. Shop Now.
Read more >
ProductionMode - Instagram
3993 Followers, 2789 Following, 784 Posts - See Instagram photos and videos from Production Mode // Jamie Hayes (@productionmode)
Read more >
Mode of production - Wikipedia
In the Marxist theory of historical materialism, a mode of production is a specific combination of the: Productive forces: these include human labour...
Read more >
Production Mode - Developer Help
This section focuses on the production mode, which is one of the two application modes of the IPE. The Integrated Programming Environment (IPE)...
Read more >
Development and production modes - Expo Documentation
Development mode includes useful warnings and gives you access to tools that make development and debugging easier. Production mode minifies your code and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found