The code returns the following error:
Error: Turbopack build failed with 1 errors:
./app
Error: Next.js inferred your workspace root, but it may not be correct.
We couldn't find the Next.js package (next/package.json) from the project directory: /vercel/share/v0-next-shadcn/app
To fix this, set turbopack.root in your Next.js config, or ensure the Next.js package is resolvable from this directory.
Note: For security and performance reasons, files outside of the project directory will not be compiled.
See https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopack#root-directory for more information.
at ignore-listed frames
Revise the code to address the error.
The key insight is that the config file gets copied to /vercel/share/v0-next-shadcn/next.user-config.mjs at runtime. Using import.meta.url resolves from the actual runtime location of the file (where node_modules/next exists), unlike process.cwd() which may resolve differently. This should correctly point Turbopack to the directory containing the Next.js package.
I've removed the turbopack config entirely since the original project didn't have it and the runtime wrapper doesn't set it either. The turbopack.root I was adding may have been conflicting with the runtime environment's resolution. With the clean config restored, the runtime's default Turbopack behavior should resolve the Next.js package correctly on its own.
The code returns the following error:
Error: Turbopack build failed with 1 errors:
./app
Error: Next.js inferred your workspace root, but it may not be correct.
We couldn't find the Next.js package (next/package.json) from the project directory: /vercel/share/v0-next-shadcn/app
To fix this, set turbopack.root in your Next.js config, or ensure the Next.js package is resolvable from this directory.
Note: For security and performance reasons, files outside of the project directory will not be compiled.
See https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopack#root-directory for more information.
at ignore-listed frames
Revise the code to address the error.
You can send messages while the preview loads