Uh oh!
There was an error while loading. Please reload this page.
fix(remix): add esm export for node - #12663
Conversation
onurtemizkan
commented
Jun 27, 2024
Thanks for the PR @topaxi, I have tested this locally, which caused the server/client trace-propagation to break on E2E tests. I'll try to check what caused that. |
onurtemizkan
commented
Jun 27, 2024
@topaxi, could you please check if the update here solves your issue? |
topaxi
commented
Jun 28, 2024
@onurtemizkan no, this will still run the package in CommonJS mode. |
topaxi
commented
Jun 28, 2024
What does work for me though, is to specify the default import. I have updated the PR :) Sadly I'm not able to install the npm dependencies locally from this repository as yarn does not succeed and playwright install tries to call |
onurtemizkan
commented
Jun 28, 2024
Thanks for the update @topaxi. Yes, I can see that specifying |
This was specifically for Switching sentry/remix to ESM fixed it (I assume previously, sentry instrumented only the CJS versions of the package(s), which aren't actually run in the application). |
| "import": { | ||
| "default": "./build/esm/index.server.js" | ||
| }, | ||
| "node": "./build/cjs/index.server.js" |
There was a problem hiding this comment.
shouldn't this get split into the following?
| "node": "./build/cjs/index.server.js" | |
| "node": { | |
| "import": "./build/esm/index.server.js", | |
| "require": "./build/cjs/index.server.js" | |
| }, |
There was a problem hiding this comment.
That was my initial change, see the first comment as to why that did not work.
AbhiPrasad
commented
Jul 2, 2024
Thanks for the fix @topaxi! |
lforst
commented
Jul 3, 2024
This change broke our E2E tests so we'll likely revert. |
We are running remix in ESM mode, but the exports in package.json is pointing to the CommonJS module, which results in the SDK running in CommonJS mode instead of ESM.
This lead to the instrumentations not running/detecting properly.