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
- Update tinyify to 4.x Should fix https://github.com/visionmedia/superagent/issues/1743 — committed to lorand-horvath/superagent by lorand-horvath 4 years ago
- fix: fixed sourceType back to module (closes #1743) — committed to perrin4869/superagent by titanism 4 years ago
- fix: fixes tinyify / require is not defined issued (closes #1743 and closes #1747) — committed to perrin4869/superagent by titanism 4 years ago
- fix: lock tinyify to 3.0.0 (fixes <https://github.com/ladjs/superagent/issues/1743\#issuecomment-2291727561>) — committed to forwardemail/superagent by titanism 2 years ago
Please release
v8.0.0asv8.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 superagentstill 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
tinyifylocked to3.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.jsfile.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.