sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

SDK doesn't support import assertions yet

Open Zarathustra2 opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [X] I have reviewed the documentation https://docs.sentry.io/
  • [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

"@sentry/nextjs": "^7.113.0",

Framework Version

18.2.0

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

Add following import line with the assert statement

import data from "../../data/foo.json" assert { type: "json" }

See: https://github.com/getsentry/sentry-javascript/issues/8442#issuecomment-2100441600

Expected Result

Sentry should not throw an SyntaxError

Actual Result

SyntaxError: Unexpected token (9:48) in __SENTRY_WRAPPING_TARGET_FILE__.cjs
[@sentry/nextjs] Could not instrument /vercel/path0/pages/<SOME_PAGE>/index.js. An error occurred while auto-wrapping:

Zarathustra2 avatar May 08 '24 12:05 Zarathustra2

Thanks! Putting on the backlog.

lforst avatar May 08 '24 12:05 lforst

A PR closing this issue has just been released 🚀

This issue was referenced by PR #15589, which was included in the 9.5.0 release.

github-actions[bot] avatar Mar 06 '25 18:03 github-actions[bot]