Open xzilja opened 2 years ago
I could confirm an issue when using npm
workspaces. Likely introduced by https://github.com/vercel/next.js/pull/39520 since the first release containing the problem is v12.2.6-canary.0
.
Switching to pnpm works, so it's something to do with how npm workspaces handle the dependencies.
After some internal discussions, the issue seems to be that there are two copies of react
, one in <root>/node_modules
, and another <root>/examples/react/node_modules
.
Could you try removing the node_modules
folders and the package-lock.json
file and re-run npm install; npm run build
to clear it up?
@balazsorban44 yeh, that was one of the first things I did when trying to debug this actually. Unfortunately issue still persists in 12.3.x
In your case there is a third directory/react instance in packages/react/node_modules
did you remove that as well?
Just tried again, essentially
node_modules
in the project12.3.1
npm install
(root)npm run build
(root)Still failing, I noticed that after install total number of packages is 178
, however with next 12.2.x
it is 177
Hey guys, I've had this issue also while creating an application with nx js and trying to import a library.
What I've discovered was that the nx js was creating the project without a _document.tsx and this was causing the errors for our project.
After I've added the _document.tsx file, the build worked.
Hey guys, I've had this issue also while creating an application with nx js and trying to import a library.
What I've discovered was that the nx js was creating the project without a _document.tsx and this was causing the errors for our project.
After I've added the _document.tsx file, the build worked.
I have the _document.js file there and still build does not work. (next: ^12.1.2)
It's important to have this structure:
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
Especially the Head from next, which includes the scripts
I was troubleshooting this "Collecting page data to fail during build" error too. In the end it turned out that I was initiating a circular dependency. Not even using it, just initiated. After removing it, the error was gone.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
After upgrading from
12.2.5
to12.3.0
or12.3.1
I started getting build errors during "Collecting page data" step. Error output includesExpected Behavior
Should build without issues
Link to reproduction
https://github.com/WalletConnect/web3modal
To Reproduce
examples/react/package.json
change next.js version to12.3.1
npm install; npm run build