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
{{ message }}
Repository navigation
Error in typescript but not javascript: TypeError: Cannot read property 'decode' of undefined #441
I'm running into an issue where attempting to create a new SourceMapConsumer doesn't work in typescript but does in javascript. Tested with the following code:
In a js file, this logs a BasicSourceMapConsumer object. In a ts file, I get the following error
property 'decode' of undefined
at new URLStateMachine (url-state-machine.js:546)
at Object.module.exports.basicURLParse (url-state-machine.js:1264)
at new URLImpl (URL-impl.js:13)
at Object.setup (URL.js:317)
at new URL (URL.js:26)
at util.js:179
at Object.computeSourceURL (util.js:431)
at source-map-consumer.js:207
at Array.map (<anonymous>)
at source-map-consumer.js:206
Activity
rmuratov commentedon Aug 24, 2023
I have encountered the same issue. It looks like something related to
whatwg-url.My workaround:
whatwg-urlto the latest version (in my case, 7.0.0 -> 13.0.0)After that, it works fine. But, of course, it is super hacky.