question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`global is not defined`

See original GitHub issue

⚠️ IMPORTANT ⚠️ Please do not ignore this template. If you do, your issue will be closed immediately.

Describe the bug

I’m getting global is not defined error.

Screen Shot 2021-03-20 at 5 38 00 PM

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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
volkanunsalcommented, Mar 23, 2021

No

On Tue, Mar 23, 2021 at 5:09 AM Matias Capeletto @.***> wrote:

@volkanunsal https://github.com/volkanunsal if you would like to discuss this further, would you open a Discussion https://github.com/vitejs/vite/discussions or join Vite Land https://chat.vitejs.dev/ to chat with others about possible solutions. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vitejs/vite/issues/2618#issuecomment-804740329, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABFAMF6DRPG424AOMNLJUTTFBLEPANCNFSM4ZQ23SQQ .

1reaction
patak-devcommented, Mar 23, 2021

@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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found