Closed asos-craigmorten closed 3 years ago
I saw the same error, but it didn't seem to be caused by a destructuring in catch
. Instead it happened due to a for await …
.
Workaround: Adding await true;
on top of the function.
Closing as stale and no longer impacting my projects. If impacting others feel free to-reopen!
Ran into the error
TypeError: Cannot read property 'referencePaths' of undefined
while playing with swapping custom Rollup for microbundle on an existing project.The error seems to arise when attempting to destructure the error argument in a
catch
statement.Minimal code for reproduction:
As far as I'm concerned this is small issue and easily remedied from the consumers end by not destructuring (not sure if this is particularly best practice anyway - would certainly fall over if anything other than an
Object
was thrown!).Raising this issue for reference so future consumers can easily find what the issue is and how to remedy it.
Abridged stack trace:
Issue location in code: https://github.com/rpetrich/babel-plugin-transform-async-to-promises/blob/d28455f0cc496d7c7005ea5975ad44cf9383eb6c/async-to-promises.ts#L3270