Open robko23 opened 1 year ago
Hi, following the reproduction steps, I cannot see any of those warnings. :thinking: Could you link to a public GitHub repository that we can use to investigate?
I have had trouble recreating this issue on my work machine, however I managed to create dockerfile where the bug still is.
FROM node:18
RUN apt update
RUN apt install -y jq moreutils
RUN corepack enable
RUN corepack prepare yarn@stable --activate
RUN yarn create next-app --experimental-app --ts --eslint test
WORKDIR /test
RUN jq '.scripts.dev = "next dev --turbo"' package.json | sponge package.json
CMD yarn dev
To set it up run:
docker build -t next-42651 .
docker run --rm -it -p 3000:3000 next-42651
Thanks, I could reproduce it with Yarn 2+. pnpm
, Yarn 1, and npm
work fine.
I am seeing this too in a pnpm
monorepo
I found that in standalone/node_modules/next
points to .pnpm/next@12.../next/dist/server/next-server.js
. That file exists but none of its imports are present. This file is created right after I run pnpm exec next build
, if I delete it then I can start my standalone server.
Same happens with npm
workspaces. Also, both cases are without using turbopack.
Here's a reproduction with
See screenshots in https://github.com/belgattitude/artist/pull/4
git clone -b nextjs-turbopack-issue --single-branch https://github.com/belgattitude/artist.git
corepack enable
pnpm i
cd apps/web
pnpm dev --turbo
We currently don't support Yarn PnP, but you can use yarn config set nodeLinker node-modules
to switch to normal node_modules mode for Yarn, which should work.
@sokra thanks for the reminder. Just to bring your attention that reproduction I sent above is with pnpm (not yarn pnp) in case you've missed it. I don't think so but... who knows 😄
Error: Cannot find module 'next/dist/server/node-polyfill-fetch'
... when trying to load an app with Turbopack.
Just a note: this is currently very low priority as we would have to implement the whole pnp resolution for turbopack
I already implemented the PnP resolution for Rust as a crate, in https://github.com/arcanis/pnp-rust. I'm very open to merge any change necessary to make it easier to use on your side.
The Trubo brand has done an amazing job of pushing monorepo tooling forward. Similarly PnP has been a big life improvement for managing a large monorepo. I believe lack of support for PnP would be a big miss for the Turbo brand as great monorepo compatible tooling.
Part of the Turbo philosophy is "never doing the same work twice". I believe Yarn Zero-installs operates under the same philosophy.
I understand that PnP is less popular then traditional node_modules, but a Turbo Pack + PnP combo would be a big quality of life improvement for large projects. I understand you have a lot more people to answer to then just us PnP folk, but I urge the team to reconsider support. Is it possible @arcanis existing work could be used to make PnP happen?
Thanks for all the hard work the teams does!
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
When creating new next app with
yarn create next-app --experimental-app
and enabling turbopack, it will result in several warnings and error:Expected Behavior
It should display default nextjs page after project creation
Link to reproduction
To Reproduce
yarn create next-app --experimental-app
"dev": "next dev --turbo",
yarn dev
PACK-2244