当前位置:网站首页>Vite+web3:报错出现ReferenceError: process is not defined
Vite+web3:报错出现ReferenceError: process is not defined
2022-06-24 18:32:00 【任磊abc】
近期使用vite脚手架搭建一个区块链项目,需要web3这个依赖库,但是在项目当中引入web3后,报错出现:
解决方案是在vite配置文件vite.config.js当中配置:
// vite.config.js
import { defineConfig } from 'vite'
export default defineConfig({
⋮
resolve: {
alias: {
web3: 'web3/dist/web3.min.js',
},
// or
alias: [
{
find: 'web3',
replacement: 'web3/dist/web3.min.js',
},
],
},
})
然后正常引入即可:
import web3 from 'web3';
console.log(web3);
边栏推荐
- Implementation of pure three-layer container network based on BGP
- Rapidssl getting started SSL certificate
- LC 300. Longest increasing subsequence
- Continue to help enterprises' digital transformation -tce has obtained the certification of the first batch of digital trusted service platforms in China
- Design topic: MATLAB UAV flight operation
- EasyGBS视频平台TCP主动模式拉流异常情况修复
- 专有云TCE COS新一代存储引擎YottaStore介绍
- Flutter dart regular regexp matches non printing characters \cl\cj\cm\ck
- How does the chief information security officer discuss network security with the enterprise board of directors
- NVM download, installation and use
猜你喜欢
Mengyou Technology: tiktok current limiting? Teach you to create popular copywriting + popular background music selection
Creating a new MySQL user in Amazon RDS environment - creating a new MySQL user in Amazon RDS environment
Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs
Network security database penetration of secondary vocational group in 2022
How to start cloud native application development
Skills of writing test cases efficiently
How MySQL works - Chapter 14
About swagger
Regression testing strategy for comprehensive quality assurance system
Two micro service interviews where small companies suffer losses
随机推荐
投资理财产品的钱能随时取出来吗?
专有云TCE COS新一代存储引擎YottaStore介绍
Exception: Gradle task assembleDebug failed with exit code 1
Provide secure and convenient Oracle solutions for smart contract developers
Paper sharing | self supervised learning paper jointly released by Yann Lecun and read by engineers
Complete Guide to web application penetration testing
Ten excellent business process automation tools for small businesses
It is often blocked by R & D and operation? You need to master the 8 steps before realizing the requirements
Selection (031) -cool_ How long can secret be accessed?
Two micro service interviews where small companies suffer losses
Can the money invested in financial products be withdrawn at any time?
Wechat applet development - Implementation of rotation chart
Noi Mathematics: solution of quadratic congruence equation
The 'ng' entry cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Check the spelling of the name. If you include a path, make sure the path is correct, and then
Continue to help enterprises' digital transformation -tce has obtained the certification of the first batch of digital trusted service platforms in China
Why are more and more people studying for doctors? Isn't it more and more difficult to graduate a doctor?
What makes data analysts good- Cassie Kozyrkov
13 skills necessary for a competent QA Manager
The mixed calculation of rpx and PX in JS by the uniapp applet
股票网上开户安全吗?应该怎么办理?