Uncaught ReferenceError: process is not defined (using vue_cli , vuetify and electron)

74 Views Asked by At

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
    }`
  }
});

``

0

There are 0 best solutions below