Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ref(nuxt): Add instument.server.mjs to preview script#38

Merged
s1gr1d merged 3 commits intomaingetsentry/sentry-javascript-examples:mainfrom
sig/instrument-sentry-nuxtgetsentry/sentry-javascript-examples:sig/instrument-sentry-nuxtCopy head branch name to clipboard
Jul 26, 2024
Merged

ref(nuxt): Add instument.server.mjs to preview script#38
s1gr1d merged 3 commits intomaingetsentry/sentry-javascript-examples:mainfrom
sig/instrument-sentry-nuxtgetsentry/sentry-javascript-examples:sig/instrument-sentry-nuxtCopy head branch name to clipboard

Conversation

@s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jul 10, 2024

This setup for ESM-compatibility throws an error and the pages cannot load. I think this is also related to this issue: nodejs/import-in-the-middle#139

Another comment where people have problems with vue/server-renderer: getsentry/sentry-javascript#12114 (comment)

Steps to reproduce the import-in-the-middle issue:

  • define the SENTRY_DSN environment variable
  • Build the nuxt project
  • Preview the nuxt project
  • Load a page

Error Message:

Error: 'import-in-the-middle' failed to wrap 'file:///Users/sigridh/Documents/DEV/sentry-javascript-examples/apps/nuxt/.output/server/node_modules/vue/server-renderer/index.mjs'
    at getSource (/Users/sigridh/Documents/DEV/sentry-javascript-examples/node_modules/@sentry/nuxt/node_modules/import-in-the-middle/hook.js:304:21)
    at async load (/Users/sigridh/Documents/DEV/sentry-javascript-examples/node_modules/@sentry/nuxt/node_modules/import-in-the-middle/hook.js:319:26)
    at async nextLoad (node:internal/modules/esm/hooks:865:22)
    at async Hooks.load (node:internal/modules/esm/hooks:448:20)
    at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18) {
  cause: TypeError: emitImportAssertionWarning is not a function
      at defaultLoad (node:internal/modules/esm/load:119:5)
      at nextLoad (node:internal/modules/esm/hooks:865:28)
      at getExports (/Users/sigridh/Documents/DEV/sentry-javascript-examples/node_modules/@sentry/nuxt/node_modules/import-in-the-middle/lib/get-exports.js:80:27)
      at processModule (/Users/sigridh/Documents/DEV/sentry-javascript-examples/node_modules/@sentry/nuxt/node_modules/import-in-the-middle/hook.js:131:29)
      at getSource (/Users/sigridh/Documents/DEV/sentry-javascript-examples/node_modules/@sentry/nuxt/node_modules/import-in-the-middle/hook.js:269:31)
      at load (/Users/sigridh/Documents/DEV/sentry-javascript-examples/node_modules/@sentry/nuxt/node_modules/import-in-the-middle/hook.js:319:32)
      at nextLoad (node:internal/modules/esm/hooks:865:28)
      at Hooks.load (node:internal/modules/esm/hooks:448:26)
      at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24)
      at [nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20)
}

@s1gr1d s1gr1d force-pushed the sig/instrument-sentry-nuxt branch from 21e0d6a to 6c500aa Compare July 10, 2024 12:00
@s1gr1d s1gr1d force-pushed the sig/instrument-sentry-nuxt branch from 6c500aa to 644c8d4 Compare July 10, 2024 12:01
@AbhiPrasad
Copy link

Could you force yarn to resolve import-in-the-middle@1.9.0? Curious to see if that changes the error.

@s1gr1d
Copy link
Member Author

s1gr1d commented Jul 10, 2024

I added it to resolutions and also dependencies, but the error persists

@s1gr1d
Copy link
Member Author

s1gr1d commented Jul 23, 2024

This was fixed with version 1.10.0 of import-in-the-middle 🎉
ref: nodejs/import-in-the-middle#140 and nodejs/import-in-the-middle#145

@s1gr1d s1gr1d merged commit 021592b into main Jul 26, 2024
@s1gr1d s1gr1d deleted the sig/instrument-sentry-nuxt branch July 26, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.