GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — V8 Integrations are broken · Issue #12582 · getsentry/sentry-javascript

V8 Integrations are broken #12582

New issue
Copy link
New issue
Copy link
Closed
#12589
Closed
V8 Integrations are broken#12582
#12589
Copy link
Assignees
onurtemizkan

Description

@depsimon
depsimon
opened on Jun 20, 2024
Issue body actions

Is 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 SDK are you using?

@sentry/remix

SDK Version

8.10.0

Framework Version

Remix 2.9.2

Link to Sentry event

No response

SDK Setup

// apps/project/app/modules/sentry/monitoring.server.ts
import { nodeProfilingIntegration } from "@sentry/profiling-node";
import * as Sentry from "@sentry/remix";

export function init() {
  Sentry.init({
    dsn: import.meta.env.VITE_SENTRY_DSN,
    environment: import.meta.env.VITE_ENVIRONMENT,
    debug: true,
    autoInstrumentRemix: true,

    // Set tracesSampleRate to 1.0 to capture 100%
    // of transactions for performance monitoring.
    // We recommend adjusting this value in production
    tracesSampleRate: 1.0,
    profilesSampleRate: 1.0, // Profiling sample rate is relative to tracesSampleRate

    denyUrls: [
      /\/healthcheck/,
      // TODO: be smarter about the public assets...
      /\/build\//,
      /\/favicons\//,
      /\/images\//,
      /\/fonts\//,
      /\/apple-touch-.*/,
      /\/robots.txt/,
      /\/favicon.ico/,
      /\/site\.webmanifest/,
    ],

    integrations: [
      // Temporary disabling this because of https://github.com/getsentry/sentry-javascript/issues/12568
      // nodeProfilingIntegration(),
      // Add profiling integration to list of integrations
      Sentry.nativeNodeFetchIntegration(),
      Sentry.httpIntegration(),
      Sentry.httpClientIntegration(),
    ],

    beforeSendTransaction(event) {
      // ignore all healthcheck related transactions
      if (event.request?.headers?.["X-Healthcheck"] === "true") return null;

      return event;
    },
  });
}
// apps/project/app/entry.server.tsx

if (import.meta.env.VITE_SENTRY_DSN) {
  await import("./modules/sentry/monitoring.server.ts");
}

Steps to Reproduce

  1. Launch remix app with remix vite:build
  2. Open app in browser
  3. An Internal server error occurs
__vite_ssr_import_0__.nativeNodeFetchIntegration is not a function
    at eval (/Users/simon/Code/Project/monorepo/apps/project/app/modules/sentry/monitoring.server.ts:32:27)
    at async instantiateModule (file:///Users/simon/Code/Project/monorepo/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:55058:9

Expected Result

Integrations being added.

Actual Result

Integrations are not recognized and break the app.

Activity

  1. depsimon
    added
    Type: Bug
    on Jun 20, 2024
  2. getsantry
    added
    Waiting for: Product Owner
    on Jun 20, 2024
  3. getsantry
    added this to GitHub Issues with 👀 3on Jun 20, 2024
  4. getsantry
    moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 20, 2024
  5. github-actions
    added
    Package: remix
    on Jun 20, 2024
  6. AbhiPrasad commented on Jun 20, 2024

    @AbhiPrasad
    AbhiPrasad
    on Jun 20, 2024
    Contributor
    More actions

    @onurtemizkan could you take a look?

    Reacted by Onur Temizkan
  7. getsantry
    removed
    Waiting for: Product Owner
    on Jun 20, 2024
  8. getsantry
    moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 20, 2024
  9. AbhiPrasad
    assigned
    onurtemizkan
    on Jun 20, 2024
  10. onurtemizkan commented on Jun 20, 2024

    @onurtemizkan
    onurtemizkan
    on Jun 20, 2024
    Contributor
    More actions

    Hi @depsimon, are you using a built-in Remix server or an Express custom server in your project?

  11. depsimon commented on Jun 20, 2024

    @depsimon
    depsimon
    on Jun 20, 2024
    Author
    More actions

    @onurtemizkan It's the built-in Remix server locally. Deployed on Vercel if that matters, but the issue is happening locally as well.

  12. getsantry
    added
    Waiting for: Product Owner
    on Jun 20, 2024
  13. getsantry
    moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 20, 2024
  14. onurtemizkan commented on Jun 20, 2024

    @onurtemizkan
    onurtemizkan
    on Jun 20, 2024
    Contributor
    More actions

    So I guess the problem is that with the new version, the Sentry SDK should be initialized before any other imports to your server.entry. (This only applies for built-in Remix servers)

    Even moving it to the top of the file before any other imports won't help because ESBuild reorders the imports (which is out of our control) in the bundle. So the workaround for that for the time being is running the remix server with --require or --import like:

    NODE_OPTIONS='--import=./instrument.server.mjs' remix-serve build
    # or
    NODE_OPTIONS='--require=./instrument.server.cjs' remix-serve build

    If that doesn't help, you can also try removing autoInstrumentRemix from your init config to fall back to the non-OTEL implementation to check if it resolves the issue.

    The docs are updated so you can refer to: https://docs.sentry.io/platforms/javascript/guides/remix/manual-setup/

  15. getsantry
    removed
    Waiting for: Product Owner
    on Jun 20, 2024
  16. getsantry
    moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 20, 2024
  17. AbhiPrasad commented on Jun 20, 2024

    @AbhiPrasad
    AbhiPrasad
    on Jun 20, 2024
    Contributor
    More actions

    @onurtemizkan should we make the wizard add NODE_OPTIONS=... to the remix-serve command?

  18. depsimon commented on Jun 20, 2024

    @depsimon
    depsimon
    on Jun 20, 2024
    Author
    More actions

    I'm not sure this solves the issue.
    I've tried the NODE_OPTIONS & removing autoInstrumentRemix but I still have the exact same issue.

    To test I removed the dynamic import of monitoring.server.js, moved its content to ./monitoring.mjs and updated the dev script like so: "dev": "NODE_OPTIONS='--import=./monitoring.mjs' remix vite:dev",

    It's really relative to the integrations exported by @senty/remix I believe.

    I tried to remove them while keeping the autoInstrumentRemix and this works (the classic way, by dynamically importing it in my entry.server.tsx)

    Side note, we don't use the remix-serve command anymore since Vite has been brought to Remix.

  19. getsantry
    added
    Waiting for: Product Owner
    on Jun 20, 2024
  20. getsantry
    moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 20, 2024
  21. onurtemizkan commented on Jun 20, 2024

    @onurtemizkan
    onurtemizkan
    on Jun 20, 2024
    Contributor
    More actions

    should we make the wizard add NODE_OPTIONS=... to the remix-serve command?

    @AbhiPrasad, yes makes sense. I'll open a PR for that 👍

    @depsimon, that's interesting. I'll try to reproduce this locally.

  22. getsantry
    removed
    Waiting for: Product Owner
    on Jun 20, 2024
  23. getsantry
    moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 20, 2024
  24. AbhiPrasad
    closed this as completedin #12589on Jun 20, 2024
  25. onurtemizkan commented on Jun 20, 2024

    @onurtemizkan
    onurtemizkan
    on Jun 20, 2024
    Contributor
    More actions

    @depsimon, we have updated the exports from Remix SDK which should resolve this issue. Please reopen if you have problems with the next release.

    Reacted by Simon Depelchin
  26. AbhiPrasad commented on Jun 21, 2024

    @AbhiPrasad
    AbhiPrasad
    on Jun 21, 2024
    Contributor
    More actions

    Fix released with https://github.com/getsentry/sentry-javascript/releases/tag/8.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @onurtemizkan
    onurtemizkan

Labels

No labels
No labels

Projects

  • GitHub Issues with 👀 3
    Status
    No status
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.