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

sveltekit auto-instrumentation problem with satisfies #8225

Closed
3 tasks done
fcrozatier opened this issue May 26, 2023 · 8 comments · Fixed by #8254
Closed
3 tasks done

sveltekit auto-instrumentation problem with satisfies #8225

fcrozatier opened this issue May 26, 2023 · 8 comments · Fixed by #8254

Comments

@fcrozatier
Copy link

fcrozatier commented May 26, 2023

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/sveltekit

SDK Version

7.53.1

Framework Version

No response

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

Worked fine a few days ago, now pnpm build throws a build error because of load functions with a satisfies ts expression. I didn't manage to make a minimal reproduction

Workaround: disabling the auto instrumentation fixes it.

sentrySvelteKit({ autoInstrument: false })

Expected Result

should build

Actual Result

[sentry-auto-instrumentation] Could not load /+page.server.ts: did not recognize object of type "TSSatisfiesExpression"
error during build:
Error: Could not load /+page.server.ts: did not recognize object of type "TSSatisfiesExpression"
at Object.getFieldNames (/node_modules/.pnpm/ast-types@0.15.2/node_modules/ast-types/lib/types.js:664:19)
at getSortedChildNodes (/node_modules/.pnpm/recast@0.22.0/node_modules/recast/lib/comments.js:53:23)
at getSortedChildNodes (/node_modules/.pnpm/recast@0.22.0/node_modules/recast/lib/comments.js:62:9)
at decorateComment (/node_modules/.pnpm/recast@0.22.0/node_modules/recast/lib/comments.js:70:22)
at decorateComment (/node_modules/.pnpm/recast@0.22.0/node_modules/recast/lib/comments.js:82:13)
at decorateComment (/node_modules/.pnpm/recast@0.22.0/node_modules/recast/lib/comments.js:82:13)
at /node_modules/.pnpm/recast@0.22.0/node_modules/recast/lib/comments.js:119:9
at Array.forEach ()
at Object.attach (/node_modules/.pnpm/recast@0.22.0/node_modules/recast/lib/comments.js:117:14)
at Object.parse (/node_modules/.pnpm/recast@0.22.0/node_modules/recast/lib/parser.js:107:16)
 ELIFECYCLE  Command failed with exit code 1.

@janvotava
Copy link

Based on my very short observation it did seem like a problem caused by magic-string bump, downgrade to SDK version 7.53.0 fixed a build for me.

@Lms24
Copy link
Member

Lms24 commented May 30, 2023

Hey @fcrozatier and @janvotava thanks for reporting! I'll take a look at this today!

@Lms24
Copy link
Member

Lms24 commented May 30, 2023

Based on my very short observation it did seem like a problem caused by magic-string bump

Possibly but I think the likelier cause is #8083 which parses the AST in +page.(server.)?ts files.

@wtachau
Copy link

wtachau commented Jun 1, 2023

FYI I see

■  Error while setting up the SvelteKit SDK:
│
●  Error: did not recognize object of type "TSSatisfiesExpression"

while running the installation wizard, is that related?

@Lms24
Copy link
Member

Lms24 commented Jun 1, 2023

Dang it, it's probably the same thing in the wizard - we need to bump magicast. Thanks, will fix this tomorrow!

@Lms24
Copy link
Member

Lms24 commented Jun 2, 2023

@wtachau we just released an update for the wizard. If you run it again now (with npx @sentry/wizard@latest -i sveltekit, it should work :)

@wtachau
Copy link

wtachau commented Jun 2, 2023

Thanks! Now I see

  TypeError: config.plugins.splice is not a function

You mentioned in the other thread that you're OOO, so I'll create a new issue.

@wtachau
Copy link

wtachau commented Jul 17, 2023

Taking another stab at this after a few updates and the issue still happens, I created getsentry/sentry-wizard#363

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.

4 participants