You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After compiling an application with retry in it, you get an error saying Cannot read properties of undefined (reading 'createTimeout') originating from this file: https://unpkg.com/browse/retry@0.13.1/lib/retry.js
$65d25f58acbeda74$export$7b8f6cec25af9dd=function(options){vartimeouts=$65d25f58acbeda74$export$968081c158f72864(options);// ...};$65d25f58acbeda74$export$968081c158f72864=function(options){// ...timeouts.push(this.createTimeout(i,opts));// this is undefined// ...};
And surprisingly, there is no special case for this with ESM
I stumbled across this issue just now.
I have the same problem when using langchainjs lib which has retry as a dependency.
You can use the --no-scope-hoist option in your build command. Then this will not happen and works for me.
Not a top solution as there is a reason why parcel has scope hoisting, but seems problematic in that case.
🐛 bug report
After compiling an application with
retry
in it, you get an error sayingCannot read properties of undefined (reading 'createTimeout')
originating from this file: https://unpkg.com/browse/retry@0.13.1/lib/retry.js🎛 Configuration (.babelrc, package.json, cli command)
No config
🤔 Expected Behavior
It should work the same in production as in development
😯 Current Behavior
Only works fine in development, in production it throws
Cannot read properties of undefined (reading 'createTimeout')
when trying to use the library💁 Possible Solution
Not sure yet, just gonna write my own fork of retry for now...
🔦 Context
Trying to use
p-retry
which usesretry
under the hoodThe text was updated successfully, but these errors were encountered: