0

I have an Uncaught ReferenceError: process is not defined error in an electron application mixed with vue_cli and vuetify I'm new to Webpack and don't know where to start looking. Can anyone help?

Webpack config

My expectation was to resolve the error and ensure that the application functions smoothly across different environments without encountering the 'process is not defined' issue."

``

const { defineConfig } = require('@vue/cli-service');
const pathModule = require('path');
const webpack = require('webpack');
const dotenv = require('dotenv');

// Charger les variables d'environnement à partir du fichier .env

module.exports = defineConfig({
  transpileDependencies: [
    'vuetify'
  ],
  // Options de configuration de Webpack
  configureWebpack: {
    plugins: [
      // Utiliser webpack.DefinePlugin pour injecter les variables d'environnement dans le code
      new webpack.DefinePlugin({
      //  'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) ,
        // Injecter les variables d'environnement à partir de  dotenv
        process: 'process'

      })
    ],
    resolve: {
      fallback: {
        'path': require.resolve('path-browserify'),
        'fs': false,
        'process/browser': false,
      }
    }
  },
 ` pluginOptions: {
    electronBuilder: {
      nodeIntegration: true
    }`
  }
});

``

8
  • Where and how do you get this error? Please share more debugging details. Commented Feb 27, 2024 at 11:28
  • hello Arkellys , i get this error my google web page when i run my local ip adress via this command npm run serve Commented Feb 27, 2024 at 13:08
  • Google web page? It's an Electron app, you should look at the Electron window and never at the browser's. Commented Feb 27, 2024 at 13:30
  • Indeed, I use live rendering via the webpage to see the real-time changes made to my project to avoid encapsulating it multiple times. Commented Feb 27, 2024 at 13:46
  • I don't understand what you mean. Commented Feb 27, 2024 at 14:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.