node-retry icon indicating copy to clipboard operation
node-retry copied to clipboard

using proper scope for createTimeout

Open gautamkrishnar opened this issue 2 years ago • 4 comments

Using a proper scope to prevent errors with external bundlers

Why

I tried using node-retry with Parcel v2 it had a hard time finding the right module to map. Now when I ran the built code I got the following error:

TypeError: this.createTimeout is not a function

Using exports.* scope instead of this.* will prevent this error.

gautamkrishnar avatar Mar 06 '22 14:03 gautamkrishnar

I ran into the same problem. This fix worked for me.

tyler-ham avatar Mar 15 '22 19:03 tyler-ham

@tim-kos can you please take a look at this. Hope this can be merged into the repository.

gautamkrishnar avatar Mar 15 '22 21:03 gautamkrishnar

@tim-kos Maybe, if you see this, could you please merge? Thank you!

LeoniePhiline avatar May 10 '22 19:05 LeoniePhiline

Same exact issue here.

The code isn't technically wrong, but it's a rare pattern that some bundlers don't account for when trying to optimize modules. Please merge this soon because it's equivalent but more compatible.

For anyone looking for an immediate, albeit non-optimal solution:

parcel build --no-scope-hoist

fregante avatar Jul 18 '22 06:07 fregante