Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to reexport property at build time #4364

Closed
garthenweb opened this issue Mar 22, 2020 · 5 comments · Fixed by #4575
Closed

Fails to reexport property at build time #4364

garthenweb opened this issue Mar 22, 2020 · 5 comments · Fixed by #4575

Comments

@garthenweb
Copy link
Contributor

🐛 bug report

Using @sentry/browser fails at build time with Error: node_modules/@sentry/utils/esm/index.js does not export 'timestampWithMs'.

🎛 Configuration (.babelrc, package.json, cli command)

See https://github.com/garthenweb/parcel-bug-report-examples/tree/bug/sentry-does-not-export-timestampWithMs

🤔 Expected Behavior

Should create a proper build that is executable in the browser.

😯 Current Behavior

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.

💁 Possible Solution

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 #4216 but the error is different.

Works without scope hoisting.

💻 Code Sample

See https://github.com/garthenweb/parcel-bug-report-examples/tree/bug/sentry-does-not-export-timestampWithMs

🌍 Your Environment

Software Version(s)
Parcel 2.0.0-nightly.163
Node v12.8.1
npm v6.14.3
Operating System Windows (WSL v1/ Ubuntu Bash)
@mischnic
Copy link
Member

I've identified the problem, will be fixed after the refactoring in #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)

@xtrinch
Copy link

xtrinch commented Jun 5, 2020

@mischnic Are these fixes ever going to make it into 1.x? If not, could one avoid tree shaking this particular module only?

@mischnic
Copy link
Member

mischnic commented Jun 5, 2020

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.

@drewsynan
Copy link

drewsynan commented Jun 9, 2020

@xtrinch fwiw (in the sort term) pinning@sentry/browser to version "5.9.1" resolved this issue for me in 1.x

@xtrinch
Copy link

xtrinch commented Jun 10, 2020

Thanks @drewsynan, wish there was a better fix, but that works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants