Skip to content

Next.js 15.2.2 and turbopack causes errors with swcPlugins @swc-jotai/debug-label #46

@kvnxiao

Description

@kvnxiao
import createNextIntlPlugin from "next-intl/plugin";
import type { NextConfig } from "next";

const withNextIntl = createNextIntlPlugin();

const nextConfig: NextConfig = {
  reactStrictMode: true,
  transpilePackages: ["jotai-devtools"],
  experimental: {
    swcPlugins: [["@swc-jotai/debug-label", {}]],
  },
};

export default withNextIntl(nextConfig);
FATAL: An unexpected Turbopack error occurred. Please report the content of /var/folders/92/71h6xs417gg9kxsdcc9yh16m0000gn/T/next-panic-8fcf59b0055b73da5258d6fd022385e2.log, along with a description of what you were doing when the error occurred, to https://github.com/vercel/next.js/issues/new?template=1.bug_report.yml
[Error [TurbopackInternalError]: failed to analyse ecmascript module '[project]/src/middleware.ts [middleware-edge] (ecmascript)'

Caused by:
- failed to parse [project]/src/middleware.ts
- Transforming and/or parsing of [project]/src/middleware.ts failed
- wasm plugin bytecheck failed "failed without error information; enable debug assertions and the `alloc` feature in rancor for error information"

Debug info:
- Execution of get_entrypoints_with_issues_operation failed
- Execution of EntrypointsOperation::new failed
- Execution of Project::entrypoints failed
- Execution of Project::middleware_endpoint failed
- Execution of Project::middleware_context failed
- Execution of apply_module_type failed
- Execution of <EcmascriptModuleAsset as EcmascriptChunkPlaceable>::get_exports failed
- Execution of analyse_ecmascript_module failed
- failed to analyse ecmascript module '[project]/src/middleware.ts [middleware-edge] (ecmascript)'
- Execution of <EcmascriptModuleAsset as EcmascriptParsable>::failsafe_parse failed
- Execution of parse failed
- failed to parse [project]/src/middleware.ts
- Transforming and/or parsing of [project]/src/middleware.ts failed
- wasm plugin bytecheck failed "failed without error information; enable debug assertions and the `alloc` feature in rancor for error information"]

Get this error when using next.js 15.2.2 with next-intl configured for app router. The logs were a bit of a red herring but the culprit was from the next.config.ts specifying the debug-label swc plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions