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.

Require is not defined on vanilla js

See original GitHub issue

Hi! I’m getting an error while loading the latest version from the vanilla js browser script (https://cdn.jsdelivr.net/npm/superagent):

version: 8.0.1 browser: Edge 105.0.1343.53, Chromium 105.0.5195.125 Console output:

Uncaught ReferenceError: require is not defined
    at superagent:1:14164
    at superagent:1:269
    at superagent:1:274

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:13

github_iconTop GitHub Comments

19reactions
levinocommented, Oct 5, 2022

Please release v8.0.0 as v8.0.3. Less inconvenient for the users,

2reactions
titanismcommented, Oct 24, 2022

v8.0.3 released to npm 🎉 !!

the issue was tinyify, which bumped common-shakeify, and has a few underlying issues that need resolved before we can upgrade it. apologies for the delay, this wasn’t easy to track down.

https://github.com/visionmedia/superagent/releases/tag/v8.0.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript require() function giving ReferenceError
By default require() is not a valid function in client side javascript. I recommend you look into require.js as this does extend the...
Read more >
How to fix "require is not defined" in JavaScript / Node.js?
In our case, the error message is “require is not defined” which indicates the problem is with the variable or method named “require”....
Read more >
Javascript - How to fix ReferenceError: require is not defined
The JavaScript require() function is only available by default in Node.js environment. This means the browser won't know what you mean with the ......
Read more >
ReferenceError: require is not defined in JavaScript | bobbyhadz
To solve the "ReferenceError require is not defined" error, remove the type property if it's set to module in your package.json file and...
Read more >
How To Fix ReferenceError require is not defined in JavaScript
In this case, check your package.json file for an property called type . If that is set to module , ES6 modules will...
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