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

Identifier '$haml' has already been declared #13304

Closed
3 tasks done
rnenjoy opened this issue Aug 12, 2024 · 5 comments · Fixed by #13346
Closed
3 tasks done

Identifier '$haml' has already been declared #13304

rnenjoy opened this issue Aug 12, 2024 · 5 comments · Fixed by #13346
Assignees
Labels
Package: nuxt Issues related to the Sentry Nuxt SDK

Comments

@rnenjoy
Copy link

rnenjoy commented Aug 12, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nuxt

SDK Version

8.25.0

Framework Version

3.12.4

Link to Sentry event

No response

Reproduction Example/SDK Setup

https://github.com/rnenjoy/sentry-nuxt-bug

Steps to Reproduce

pnpm run dev

Expected Result

Instrument as usual

Actual Result

Cannot start nuxt: Identifier '$haml' has already been declared 11:31:58 AM

at compileSourceTextModule (node:internal/modules/esm/utils:337:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:163:18)
at callTranslator (node:internal/modules/esm/loader:430:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:436:30)

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Aug 12, 2024
@github-actions github-actions bot added the Package: nuxt Issues related to the Sentry Nuxt SDK label Aug 12, 2024
@s1gr1d
Copy link
Member

s1gr1d commented Aug 13, 2024

Hello, thanks for reaching out. I see that you added the node options to almost all scripts. You only need to add them to the scripts that are running your build output:

"preview": "NODE_OPTIONS='--import ./public/instrument.server.mjs' nuxt preview",
"start": "NITRO_PORT=4000 NITRO_HOST=0.0.0.0 node  --import .output/public/instrument.server.mjs .output/server/index.mjs"

In general, we optimize for the production build of applications. And thanks for filing the issue, I will make this more clear in the docs :)

@rnenjoy
Copy link
Author

rnenjoy commented Aug 13, 2024

Makes sense! Sorry for that @s1gr1d !

@s1gr1d
Copy link
Member

s1gr1d commented Aug 14, 2024

You're welcome! However, I fixed this and you should be able to add the --import flag in dev mode with v8.26.0

@florian-lefebvre
Copy link

Hi! I know this is a closed issue but I'm facing this issue in an Astro project while trying to upgrade to >=8.0. I can't manage to make a reproduction atm so I'm trying to find clues about what could be causing this, and be able to report it properly. Do you know why this error occurs at all?

@s1gr1d
Copy link
Member

s1gr1d commented Oct 15, 2024

Please be so kind and open a new issue with some more information so we can better keep track of this, thanks :)
Feel free to reference this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nuxt Issues related to the Sentry Nuxt SDK
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants