question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Failed to read source code from `amp-dev.js`

See original GitHub issue

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 of amp-dev.js.

Expected Behavior

No error.

To Reproduce

  1. yarn init -y
  2. yarn set version canary
  3. yarn add next@canary react react-dom
  4. Create pages folder
  5. yarn next
  6. Read log:
(node:14180) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./.yarn/__virtual__/next-virtual-553eee263b/0/cache/next-npm-12.0.5-canary.10-1a75536391-cbd811bead.zip/node_modules/next/dist/client/dev/amp-dev.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-553eee263b\0\cache\next-npm-12.0.5-canary.10-1a75536391-cbd811bead.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-553eee263b/0/cache/next-npm-12.0.5-canary.10-1a75536391-cbd811bead.zip/node_modules/next/dist/client/dev/amp-dev.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-553eee263b\0\cache\next-npm-12.0.5-canary.10-1a75536391-cbd811bead.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-553eee263b/0/cache/next-npm-12.0.5-canary.10-1a75536391-cbd811bead.zip/node_modules/next/dist/client/dev/amp-dev.js
Error: Failed to read source code from C:\test-nextjs\.yarn\__virtual__\next-virtual-553eee263b\0\cache\next-npm-12.0.5-canary.10-1a75536391-cbd811bead.zip\node_modules\next\dist\client\dev\amp-dev.js       

Caused by:
    The system cannot find the path specified. (os error 3)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
rtrittocommented, Jan 13, 2022

This issue will be fixed with #33236

3reactions
rtrittocommented, Dec 2, 2021

In next.js v12.0.5-canary.14, it’s fixed adding in next.config.js file:

module.exports = {
  ...
  experimental: {
    ...
    swcFileReading: false
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving validation errors - amp.dev
In this section, we'll go through and resolve the AMP validation errors from our AMP ... The file should be empty of any...
Read more >
r/nextjs - Reddit
I have a very serious issue right now trying to use Next js. No matter what version I use , any time I...
Read more >
Why am I getting amp-script "could not find element" error?
Summary: When I try to use an amp-script tag with a script attribute, it claims not to see the script. Here is the...
Read more >
module-not-found - Next.js
A module not found error can occur for many different reasons: The module you're trying to import is not installed in your dependencies;...
Read more >
node_modules/next/dist/build/webpack/loaders/css ... - You.com
No matter what version I use, any time I try to run the npm run dev , I get the following error: error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found