Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite use web3.js throw Uncaught ReferenceError: process is not defined #902

Closed
okevinok opened this issue Jun 15, 2021 · 2 comments
Closed

Comments

@okevinok
Copy link

To solve the problem "global is not defined "
`import { defineConfig, UserConfigExport, ConfigEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path';
import polyfillNode from 'rollup-plugin-polyfill-node'

export default defineConfig({
plugins: [
vue(),
polyfillNode()
],
optimizeDeps: {
exclude: ['dragula'] // <- modules that needs shimming have to be excluded from dep optimization
}
})`
and then throw Uncaught ReferenceError: process is not defined, problem .
so How can I fix it? thanks!
image

@shellscape
Copy link
Collaborator

If you are sure this is a bug or documentation issue, please take the time to refile this issue using the issue template.

Hey there, thanks for opening an issue - Unfortunately you missed (or may have disregarded) the message about issue templates being required. Because our issue template was removed, we assume that this is a support request, and that's not something we offer here. Also, if you refile, please don't ignore Issue sections. They're in the template because they're useful to the maintainers of this project.

@rollup rollup deleted a comment from dhruvkelawala Aug 27, 2021
@edeuxk
Copy link

edeuxk commented Sep 8, 2021

To solve process issue:
On vite.config.{js}{ts}

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  define: {
    'process.env': {}
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants