vue3+vite reports Uncaught ReferenceError: Buffer is not defined
See original GitHub issueDescribe the bug
version: “vue”: “^3.2.16”, “vite”: “^2.6.4”
Buffer is used for data conversion in the vue3+vite project, and the running project reports Uncaught ReferenceError: Buffer is not defined
Reproduction
The project git repository is: https://github.com/LQS5858/newmall-vue3-vite
System Info
System:
OS: macOS 11.6
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 351.83 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.4 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.15 - /usr/local/bin/npm
Browsers:
Safari: 14.1.2
Used Package Manager
npm
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:18 (5 by maintainers)
Top Results From Across the Web
Uncaught ReferenceError: Buffer is not defined - Stack Overflow
Answering my own question. Two things helped to resolve the issue: Adding plugins section with ProviderPlugin into webpack.config.js.
Read more >Buffer is not defined. Using Phantom Wallet, Solana and ...
This is happening because the default bundler that comes with create react app(webpack 5) does not polyfill Buffer .
Read more >vite搭建vue3的项目中,ReferenceError Buffer is not defined
问题:. 下载文件,后端返回buffer,前端下载;浏览器报 ReferenceError: Buffer is not defined. Buffer is not defined ...
Read more >MongoDB 3.6 shell "Buffer is not defined" - Developer Tools
Hi,. I write a js script for mongodb 3.6.3 (Ubuntu 18.04) where I want to use js / nodejs “Buffer”, but script execution...
Read more >How to polyfill Buffer with Webpack 5 | viglucci.io
How to fix 'buffer is not defined' error and polyfill the Node.js Buffer ... new Buffer(); Uncaught ReferenceError: Buffer is not defined at ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@javastation thank u it worked https://unruffled-jepsen-863a3f.netlify.app/
hmm thank u. I totally forgot about the prebuilt version. Lemme try it