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

Next.js mjs setup issue #662

Open
TheCukitoDev opened this issue Sep 3, 2024 · 4 comments
Open

Next.js mjs setup issue #662

TheCukitoDev opened this issue Sep 3, 2024 · 4 comments
Assignees

Comments

@TheCukitoDev
Copy link

Core or SDK?

Platform/SDK

Which part? Which one?

Next.js Docs (https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/)

Description

Next.js comes by default with support only for ES6 so the mjs should be the default. Also I think while installing sentry with the wizard should install the ES6 version instead of the cjs version

Suggested Solution

Install the ES6 version instead of the cjs version or add a function that detects what version uses only reading package.json select what version install. Like if it says type: module install the es6 version or in the CLI ask what version should install.

@getsantry
Copy link

getsantry bot commented Sep 3, 2024

Assigning to @getsentry/support for routing ⏲️

@mydea mydea removed their assignment Sep 4, 2024
@lforst lforst self-assigned this Sep 4, 2024
@mydea mydea changed the title Issue to avoid issue while installing Next.js mjs setup issue Sep 6, 2024
@lforst lforst transferred this issue from getsentry/sentry-docs Sep 6, 2024
@chargome
Copy link
Member

chargome commented Sep 6, 2024

@TheCukitoDev are you referring to the cjs tab being selected by default in the docs?

@lforst lforst transferred this issue from getsentry/sentry-javascript Sep 6, 2024
@TheCukitoDev
Copy link
Author

also but the main issue is while executing the wizzard doesen't cares about the project js specification. It always install the CJS version instead of the ES6 that nextjs uses.

@chargome
Copy link
Member

chargome commented Sep 9, 2024

@TheCukitoDev you are right, if no previous config was found we create a js file by default as this works with the majority of Next.js versions. We have this on our backlog 👍

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

No branches or pull requests

5 participants