Using @sentry/browser fails at build time with Error: node_modules/@sentry/utils/esm/index.js does not export 'timestampWithMs'.
Should create a proper build that is executable in the browser.
Fails with Error: node_modules/@sentry/utils/esm/index.js does not export 'timestampWithMs'. See https://github.com/garthenweb/parcel-bug-report-examples/tree/bug/sentry-does-not-export-timestampWithMs for more.
timestampWithMs is exported correctly in node_modules\@sentry\utils\esm\misc.js which is reexported in node_modules/@sentry/utils/esm/index.js.
timestampWithMs uses another export called crossPlatformPerformance, maybe this is the source of the issue?
Maybe related to https://github.com/parcel-bundler/parcel/issues/4216 but the error is different.
Works without scope hoisting.
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 2.0.0-nightly.163
| Node | v12.8.1
| npm | v6.14.3
| Operating System | Windows (WSL v1/ Ubuntu Bash)
I've identified the problem, will be fixed after the refactoring in https://github.com/parcel-bundler/parcel/pull/4411 landed.
(Note to my future self: tests and an ugly fix can be found in https://github.com/parcel-bundler/parcel/tree/resolveSymbol-wrapped-reexport)
@mischnic Are these fixes ever going to make it into 1.x? If not, could one avoid tree shaking this particular module only?
No, also because Parcel 2's scope hoisting implementation has diverged (improved) too much at this point.
If not, could one avoid tree shaking this particular module only?
That isn't possible.
@xtrinch fwiw (in the sort term) pinning@sentry/browser to version "5.9.1" resolved this issue for me in 1.x
Thanks @drewsynan, wish there was a better fix, but that works for me!
Most helpful comment
I've identified the problem, will be fixed after the refactoring in https://github.com/parcel-bundler/parcel/pull/4411 landed.
(Note to my future self: tests and an ugly fix can be found in https://github.com/parcel-bundler/parcel/tree/resolveSymbol-wrapped-reexport)