Skip to content

Why does import Web3 from 'web3' give process is not defined? #2344

Answered by buhrmi
buhrmi asked this question in Q&A
Discussion options

You must be logged in to vote

Okay, I was able to answer my own question:

// vite.config.js
import replace from '@rollup/plugin-replace';

export default {
  plugins: [
    replace({
      'process.env': import.meta.env
    })
  ]
};

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by buhrmi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants