Skip to content

Next.js canary build fails with Turbopack because our loaders load the Sentry CLI #24650

Description

@chargome

The nextjs-16 e2e app fails to build with Turbopack on next@16.4.0-canary.39:

./node_modules/sentry/dist/index.d.cts
Error: Specified module format (CommonJs) is not matching the module format of the source code (EcmaScript Modules)

Cause: our Turbopack loaders (componentAnnotationLoader, valueInjectionLoader, moduleMetadataInjectionLoader) import from @sentry/bundler-plugins/core. That entry point also loads the sentry CLI package. The canary follows the loaders' imports into the CLI package and tries to compile its TypeScript type file (index.d.cts) as code.

Compiling a type file as code is a bug in the Next.js canary, but the loaders only need two small helpers and shouldn't load the CLI at all. The stable Next.js release isn't affected.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions