New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Failed to read source code from amp-dev.js
#31812
Comments
It should depend on changes in #31772 or #31759. Edit: next.js/packages/next/build/webpack-config.ts Line 502 in b2acdbb
next.js v12.0.4 (correctly work): clientEntries: {
'main.js': [],
'react-refresh': 'C:\\test-next\\.yarn\\__virtual__\\@next-react-refresh-utils-virtual-17b7e6438c\\0\\cache\\@next-react-refresh-utils-npm-12.0.4-d8661f51f6-7c1c9c3284.zip\\node_modules\\@next\\react-refresh-utils\\runtime.js',
amp: './.yarn/__virtual__/next-virtual-f94b832183/0/cache/next-npm-12.0.4-fcbd6e5d3e-b9711e7d42.zip/node_modules/next/dist/client/dev/amp-dev',
main: './.yarn/__virtual__/next-virtual-f94b832183/0/cache/next-npm-12.0.4-fcbd6e5d3e-b9711e7d42.zip/node_modules/next/dist/client/next-dev.js'
} next.js v12.0.5-canary.11: clientEntries: {
'main.js': [],
'react-refresh': 'C:\\test-next\\.yarn\\__virtual__\\@next-react-refresh-utils-virtual-a50cc4b923\\0\\cache\\@next-react-refresh-utils-npm-12.0.5-canary.11-d08910d2ba-2bab76619a.zip\\node_modules\\@next\\react-refresh-utils\\runtime.js',
amp: './.yarn/__virtual__/next-virtual-1354126498/0/cache/next-npm-12.0.5-canary.11-e87fce5999-fdd462fb46.zip/node_modules/next/dist/client/dev/amp-dev',
main: './.yarn/__virtual__/next-virtual-1354126498/0/cache/next-npm-12.0.5-canary.11-e87fce5999-fdd462fb46.zip/node_modules/next/dist/client/next-dev.js'
} Both values are similar, so this issue shouldn't yarn side. There is a way to debug, log and/or help? FYI @sokra @timneutkens |
@rtritto any update on this? I am running into the same issues right now |
Nothing |
@rtritto Hmm that's a shame.. I upgraded to yarn 3.1 and therefore had to upgrade Next to 12 but with i am running into the same issues as you do now. Did you not have this issue on v12.0.5-canary.9? |
This issue persists with all latest yarn versions (currently 3.1.1 and 3.2.0-rc.6)
Maybe it works (bug #31552 blocks compiling after this issue is solved) |
I tried setting nodeLinker back to node-modules and that was a workaround. But also loading time went x100 because of that. So hopefully the fixes they are pushing will fix these issues so we can use yarn pnp :) |
I suspect this is caused by Next reading files on the wasm/rust side rather than JS. It means it doesn't go through the layer Yarn puts in place so that dependencies can be accessed directly from their zip archives. The simplest fix preserving the intent would be for Next to fallback to using the |
A reproduction can be found here: kachkaev/njt#161 The Preview release works for the PR, but that’s because of a workaround on the Vercel side. |
This issue, should be fixed with #31995 (already merged in canary branch). |
In module.exports = {
...
experimental: {
...
swcFileReading: false
}
} |
Maybe this issue should remain opened because of experimental (temporary) fix. |
I no longer see any mentions of |
Without ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./.yarn/__virtual__/next-virtual-c649e2e81d/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/client/dev/amp-dev.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-c649e2e81d\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\client\dev\amp-dev.js
Caused by:
The system cannot find the path specified. (os error 3)
wait - compiling...
error - ./.yarn/__virtual__/next-virtual-c649e2e81d/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/client/dev/webpack-hot-middleware-client.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-c649e2e81d\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\client\dev\webpack-hot-middleware-client.js
Caused by:
The system cannot find the path specified. (os error 3)
wait - compiling...
error - ./.yarn/__virtual__/next-virtual-c649e2e81d/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/client/dev/webpack-hot-middleware-client.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-c649e2e81d\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\client\dev\webpack-hot-middleware-client.js
Caused by:
The system cannot find the path specified. (os error 3) ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./.yarn/__virtual__/next-virtual-510b9827f9/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/client/dev/amp-dev.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-510b9827f9\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\client\dev\amp-dev.js
Caused by:
The system cannot find the path specified. (os error 3)
wait - compiling...
error - ./.yarn/__virtual__/next-virtual-510b9827f9/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/client/index.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-510b9827f9\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\client\index.js
Caused by:
The system cannot find the path specified. (os error 3)
wait - compiling...
error - ./.yarn/__virtual__/next-virtual-510b9827f9/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/client/index.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-510b9827f9\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\client\index.js
Caused by:
The system cannot find the path specified. (os error 3) ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./.yarn/__virtual__/next-virtual-c649e2e81d/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/client/dev/error-overlay/hot-dev-client.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-c649e2e81d\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\client\dev\error-overlay\hot-dev-client.js
Caused by:
The system cannot find the path specified. (os error 3)
wait - compiling...
error - ./.yarn/__virtual__/next-virtual-c649e2e81d/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/client/portal/index.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-c649e2e81d\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\client\portal\index.js
Caused by:
The system cannot find the path specified. (os error 3)
wait - compiling...
error - ./.yarn/__virtual__/next-virtual-c649e2e81d/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/client/portal/index.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-c649e2e81d\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\client\portal\index.js
Caused by:
The system cannot find the path specified. (os error 3) ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./.yarn/__virtual__/next-virtual-c649e2e81d/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/client/dev/error-overlay/format-webpack-messages.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-c649e2e81d\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\client\dev\error-overlay\format-webpack-messages.js
Caused by:
The system cannot find the path specified. (os error 3)
wait - compiling...
error - ./.yarn/__virtual__/next-virtual-c649e2e81d/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-c649e2e81d\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\shared\lib\i18n\normalize-locale-path.js
Caused by:
The system cannot find the path specified. (os error 3)
wait - compiling...
error - ./.yarn/__virtual__/next-virtual-c649e2e81d/0/cache/next-npm-12.0.8-aa55acca00-947f0295aa.zip/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-c649e2e81d\0\cache\next-npm-12.0.8-aa55acca00-947f0295aa.zip\node_modules\next\dist\shared\lib\i18n\normalize-locale-path.js
Caused by:
The system cannot find the path specified. (os error 3 I'm keeping this issue opened because of the temporary workaround with |
This issue will be fixed with #33236 |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
12.0.5-canary.10-12.0.8
What version of Node.js are you using?
14.17.0
What browser are you using?
Not relevant
What operating system are you using?
Windows
How are you deploying your application?
Not relevant
Describe the Bug
I updated
next.js
from v12.0.5-canary.9 to v12.0.5-canary.10 and I got a file not found error ofamp-dev.js
.Expected Behavior
No error.
To Reproduce
yarn init -y
yarn set version canary
yarn add next@canary react react-dom
pages
folderyarn next
The text was updated successfully, but these errors were encountered: