[@sentry/remix] - ESM error when importing @sentry/remix
See original GitHub issueIs there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
SDK Version
7.4.1
Framework Version
1.5.1
Link to Sentry event
No response
Steps to Reproduce
Running the app will surface the error. You can see the instructions here: https://github.com/webstudio-is/webstudio/blob/main/docs/contributing.md#designer-installation
Expected Result
No error happens
Actual Result
As soon as the server starts I see this error on both the browser and terminal
/Users/saravieira/Projects/webstudio-designer/node_modules/@sentry/remix/esm/index.server.js:1
import { getCurrentHub, init as init$1, configureScope } from '@sentry/node';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (/Users/saravieira/Projects/webstudio-designer/app/entry.server.tsx:5:25)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at /Users/saravieira/Projects/webstudio-designer/node_modules/@remix-run/serve/dist/index.js:43:17
at Layer.handle [as handle_request] (/Users/saravieira/Projects/webstudio-designer/node_modules/express/lib/router/layer.js:95:5)
I am currently using v16.15.1 of node
Here is the code I used in a PR: https://github.com/webstudio-is/webstudio-designer/pull/103/files
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Gotchas - Remix
Importing ESM Packages. You may try importing an ESM-only package into your app and see an error like this when server rendering: Error...
Read more >Importing pure ESM module in TS project fails Jest test with ...
I have set the ESM options as indicated here but still get a SyntaxError: Cannot use import statement outside a module error.
Read more >ESM error when trying to import Map from "@arcgis
Hi, I am trying to write tests using the create react app example and am getting the following error: To reproduce the error:...
Read more >ERR_REQUIRE_ESM - DEV Community
To save anybody's googling time Once you update you package deps you may face with the error... Tagged with esm, es6, require, import....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Working great! 🚀
Hey @SaraVieira thanks for trying
@sentry/remix
and this beautiful write-up of the issue! And thanks to our hero @nfelger for fixing this!In a few hours, we will test & review the PR so you will get a working release soon.