Webpack ReferenceError: process is not defined
See original GitHub issueIssue
Fresh electron-vue project gives webpack error:
ReferenceError: process is not defined

Reproduction
vue init simulatedgreg/electron-vue test_vue_error
cd test_vue_error
npm install
npm run dev
Screenshot of rendering error

Development environment
- Node version: v12.1.0
- NPM version: 6.9.0
- vue-cli version: 2.9.6
- Vue version: 2.6.10
- Webpack version: 4.30.0
- Operating System: OSX 10.14.4
Issue Analytics
- State:
- Created 4 years ago
- Reactions:155
- Comments:63
Top Results From Across the Web
Bundle.js - Uncaught ReferenceError: process is not defined ...
for my typescript project I added .d.ts file with such content: "declare var process: any;" · Can you explain how you'd implement that...
Read more >Uncaught ReferenceError: process is not defined, won't build ...
I tried building this in my project with latest webpack and got the following error: Uncaught ReferenceError: process is not defined,. Seems ...
Read more >ReferenceError: “process is not defined” - GIMTEC
In this case, process is not defined in the browser environment, hence the error. The solution is to remove the reference to process...
Read more >uncaught referenceerror: $ is not defined webpack - You.com
Try to use frontend-compatible modules whenever possible. · It's possible to manually add a polyfill for a node.js core module. An error message...
Read more >Uncaught: ReferenceError: process is not defined. : r/webpack
r/webpack - Uncaught: ReferenceError: process is not defined. So my project was working successfully but once I import the @dfinity/auth-client ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Experiencing the same issue on Node 12.2.0. Not sure what causes it, and not entirely convinced the issue is in this repo. Probably a dependency. Removing parts from the template will work for
npm run dev
, but not so much fornpm run build
ornpm run pack
.My temporary solution was to do modify
HtmlWebpackPlugin
in.electron-vue/webpack.web.config.js
and.electron-vue/webpack.renderer.config.js
:https://github.com/nodejs/node/pull/26882
Pretty much in node v12+ you need to explicitly import the process module.
Only change you need to make is below is update process to require(‘process’). I Can submit a PR if needed. No changes to your webpack config or anything is needed.