Skip to content

feat(node): Warn if ESM mode is detected #11914

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

Merged
merged 1 commit into from
May 6, 2024
Merged

feat(node): Warn if ESM mode is detected #11914

merged 1 commit into from
May 6, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented May 6, 2024

This prints a console.warn out if we detect that we are running in ESM mode.

@mydea mydea requested review from HazAT, timfish, lforst and s1gr1d May 6, 2024 14:28
@mydea mydea self-assigned this May 6, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

size-limit report 📦

Path Size
@sentry/browser 21.65 KB (0%)
@sentry/browser (incl. Tracing) 32.67 KB (0%)
@sentry/browser (incl. Tracing, Replay) 68.01 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.41 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.05 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.15 KB (0%)
@sentry/browser (incl. Feedback) 37.66 KB (0%)
@sentry/browser (incl. sendFeedback) 26.21 KB (0%)
@sentry/browser (incl. FeedbackAsync) 30.84 KB (0%)
@sentry/react 24.33 KB (0%)
@sentry/react (incl. Tracing) 35.63 KB (0%)
@sentry/vue 25.48 KB (0%)
@sentry/vue (incl. Tracing) 34.46 KB (0%)
@sentry/svelte 21.78 KB (0%)
CDN Bundle 24.14 KB (0%)
CDN Bundle (incl. Tracing) 34.04 KB (0%)
CDN Bundle (incl. Tracing, Replay) 67.71 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 72.92 KB (0%)
CDN Bundle - uncompressed 70.99 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 100.98 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 210.59 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 223.87 KB (0%)
@sentry/nextjs (client) 34.86 KB (0%)
@sentry/sveltekit (client) 33.23 KB (0%)
@sentry/node 146.29 KB (+0.06% 🔺)

Copy link
Collaborator

@timfish timfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We won't support ESM at all for now with Node v8?

@andreiborza
Copy link
Member

Do we not want to mention the lack of autoinstrumentation with ESM and/or point them towards some docs?

@mydea
Copy link
Member Author

mydea commented May 6, 2024

We won't support ESM at all for now with Node v8?

We will, but today we basically don't support it because of broken import-in-the-middle. A fix for that is pending and should be released this week (hopefully), then we'll update this accordingly!

@mydea mydea merged commit dd5c170 into develop May 6, 2024
83 checks passed
@mydea mydea deleted the fn/esm-warning branch May 6, 2024 15:04
@jd-carroll
Copy link

@mydea is there an issue tracking the ESM fix you referenced? We would like to adopt sentry, but will not even attempt until the SDK is ESM compatible. 🙏🏻

@ollebergkvist
Copy link

Also wondering if there is an issue to track ESM compatibility?

@andreiborza
Copy link
Member

@mydea is there an issue tracking the ESM fix you referenced? We would like to adopt sentry, but will not even attempt until the SDK is ESM compatible. 🙏🏻

Just to be clear, if you're using ESM and have a build step (i.e. a bundler, running it through tsc, etc) you should be fine. This issue is for pure ESM setups.

@jd-carroll
Copy link

Amazing, thank you for the clarification. We have spent the whole week on our ESM migration so trying to get things tied out.

But... there also seems to be a bug: #11965 🙏🏻

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

Successfully merging this pull request may close these issues.

6 participants