Skip to content

Link to the code that reproduces this issue or a replay of the bug #55327

@wilkinsonjack1993

Description

@wilkinsonjack1993

Link to the code that reproduces this issue or a replay of the bug

https://github.com/wilkinsonjack1993/next-js-webpack-bug

To Reproduce

  1. Install deps with pnpm
  2. run webapp from root: pnpm run dev:web
  3. go to localhost:3000/test - observe that pages directory pages load as expected
  4. go to localhost:3000 observe that page load fails with error: Error: Currently React only supports one RSC renderer at a time.
  5. Go to next.config.js and remove the following:
  webpack: (config, options) => {
    if (options.isServer) {
      config.externals = [
        "react",
        "next-i18next",
        "react-dom",
        ...config.externals,
      ];
    }

    config.resolve.alias["react"] = path.resolve(
      __dirname,
      ".",
      "node_modules",
      "react"
    );

    config.resolve.alias["next-i18next"] = path.resolve(
      __dirname,
      ".",
      "node_modules",
      "next-i18next"
    );

    config.resolve.alias["react-dom"] = path.resolve(
      __dirname,
      ".",
      "node_modules",
      "react-dom"
    );

    return config;
  },
  1. Run the dev server again and see that the app directory page now loads correctly

Current vs. Expected behavior

Expected: App directory page loads correctly
Actual: Error: Currently React only supports one RSC renderer at a time.

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

"node": v16.15.1
"react": "^18.2.0",
"react-dom": "^18.2.0",
"next": "13.4.19",
"pnpm": 8.6.6

Which area(s) are affected? (Select all that apply)

App Router

Additional context

We have this configuration to get around the issue described here.

We use are using transpilePackages but that also has the same issue as the old next-transpile-modules package when it comes to resolving peer dependencies in packages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.lockedstaleThe issue has not seen recent activity.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions