superagent: Require is not defined on vanilla js

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 16

Commits related to this issue

Most upvoted comments

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

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

@titanism Have you managed to find the underlying issue? Asking because npm install superagent still installs version 8.0.2 (even if it’s deprecated) and not 8.0.0. Some kind of solution/fix would be very much appreciated until this problem is solved (perhaps releasing a temporary version 8.0.3).

v10.0.2 released with tinyify locked to 3.0.0 - can you try that @patdahl?

https://github.com/ladjs/superagent/releases/tag/v10.0.2

Deprecated v8.0.1 and v8.0.2 in the interim - help would be appreciated in determining the underlying cause here. It has to do with creating the dist/superagent.min.js file.

Note that I see this bit of code in 8.0.1 and 8.0.2 that I don’t see in 8.0.0:

return"function"==typeof r&&W(t,".prototype.")>-1?_(r):r},V=require(12),Q=q("%TypeError%"),X=q("%WeakMap%",!0)

That’s the only reference to require() anywhere in the code that I get.