Open wilkinsonjack1993 opened 1 year ago
I assume this wouldn't help:
FWIW I browsed through your code and the dependency in pages/_app.tx and didn't see the "getServerSideProps" function I'd expect if you were using server-side rendering.
I think I found the problem.
So, in your /pages/test.tsx you have this line:
await serverSideTranslations(locale, ["common", "footer"]))
You're not supposed to use server-side components in the /pages directory.
@moonman239 - Thank you for taking a look at this. The issue is not with the translations, but with how adding that bit of the webpack configuration stops RSC working in the app folder. I can't work out why the root page (in the app directory) throws the error: Error: Currently React only supports one RSC renderer at a time.
.
You're not supposed to use server-side components in the /pages directory.
While you can't use RSC in the pages directory, that is not what we are doing in pages.tsx
. We are doing serverside rendering which is doable in the pages folder.
Link to the code that reproduces this issue or a replay of the bug
https://github.com/wilkinsonjack1993/next-js-webpack-bug
To Reproduce
pnpm run dev:web
localhost:3000/test
- observe that pages directory pages load as expectedlocalhost:3000
observe that page load fails with error:Error: Currently React only supports one RSC renderer at a time.
Go to
next.config.js
and remove the following: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
Provide environment information
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.