`global is not defined`
See original GitHub issue⚠️ IMPORTANT ⚠️ Please do not ignore this template. If you do, your issue will be closed immediately.
- [√ ] Read the docs.
- [√] Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- [√] This is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
Describe the bug
I’m getting global is not defined
error.
Reproduction
The header of the file has this comment block.
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
It seems to be coming from a module that includes Node.js modules, and the browser equivalent has been included, and there is a global
keyword in there, which vitejs cannot seem to handle.
System Info
vite@2.1.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Uncaught ReferenceError: global is not defined #2141 - GitHub
ncaught ReferenceError : global is not defined at Object../node_modules/buffer/index.js (index.js:43) at webpack_require (bootstrap:76)
Read more >How to fix the ReferenceError: global is not defined error in ...
That sound simple enough to fix, just create a vite.config.[js/ts] file, add it to your SvelteKit project and define global right? // vite....
Read more >Upgrading to angular-6.x gives "Uncaught ReferenceError
Then you're getting the following error Fix: "Uncaught ReferenceError: global is not defined" do it as follows node: { global: true, ...
Read more >Uncaught ReferenceError: global is not defined - YouTube
Uncaught ReferenceError: global is not defined at node_modules/@walletconnect/socket-transport/dist/esm/index.jscreate a n ew filw named ...
Read more >react global is not defined | The AI Search Engine You Control
A global variable is defined inside a script tag independent of the React app. This global variable can be data that needs to...
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
No
On Tue, Mar 23, 2021 at 5:09 AM Matias Capeletto @.***> wrote:
@volkanunsal if you would like to discuss this further, would you open a Discussion or join Vite Land to chat with others about possible solutions. Thanks!