Skip to content

SolidStart build-time instrumentation breaks mysql and ioredis on Node 24+ #24786

Description

@JPeer264

Follow up to #24343

With build-time instrumentation, @sentry/solidstart force-inlines mysql and ioredis into the Nitro server bundle, but their CommonJS dependencies stay external. Rollup reads those external dependencies through getDefaultExportFromNamespaceIfNotNamed, which only unwraps default when it is the only key on the namespace. From Node 24.0, a CommonJS namespace also has a module.exports key, so the helper returns the namespace object and the drivers break at runtime:

  • mysql: TypeError: SqlString.format is not a function
  • ioredis: TypeError: (0 , lodash_1.defaults) is not a function

This is not specific to CI, every SolidStart app with mysql or ioredis on Node 24+ is affected. The same built server fails without the Sentry --import hook, so the problem is in the bundle output, not in the runtime SDK.

Node Result
20.19.5, 22.22.3 works
24.0.0 to 24.21.0, 26.1.0 fails

External CommonJS dependencies in a SolidStart build that have only default and module.exports on Node 24: bignumber.js, sqlstring (from mysql), denque, lodash.defaults, lodash.isarguments (from ioredis). Other instrumented modules can have more. @rollup/plugin-commonjs 29.0.3 still ships the same helper.

@sentry/nuxt builds the same inline list in packages/nuxt/src/vite/orchestrion.ts. I did not verify whether Nuxt apps are affected.

Possible fixes:

  • Add the dependencies above to the inline list next to standard-as-callback in packages/solidstart/src/config/withSentry.ts (and in Nuxt, if affected). Small, but covers only the known modules.
  • Fix the interop for all external dependencies of inlined modules in sentryOrchestrionPlugin, for example with @rollup/plugin-commonjs options.

When this is fixed, remove the volta.node pin (20.19.5) from the solidstart and solidstart-static E2E apps, which #24343 added so their E2E tests keep running on Node 20.

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions