AMP First Pages: Could not find files for /xxx in .next/build-manifest.json
See original GitHub issueBug report
Describe the bug
When AMP first pages are accessed, the following error statement outputs.
Could not find files for /xxx in .next/build-manifest.json
.
These AMP pages can be viewed.
To Reproduce
- cd /zeit/next.js/examples/amp-first
- npm i
- npm run build
- npm run start
- Go to ‘localhost:3000’
- See following error in your console
> next start
ready - started server on http://localhost:3000
Could not find files for / in .next/build-manifest.json
Expected behavior
No error outputs.
Screenshots
None.
System information
- OS: macOS
- Browser (if applies) Chrome
- Version of Next.js: v9.5.3
- Version of Node.js: v13.14.0
Additional context
This error will be called in getPageFiles
here.
getPageFiles
will be called in getDocumentFiles
here.
getDocumentFiles
is called when rendering all pages that use _document.
So all pages might pass this function.
But I found that AMP First Pages was not included in build-manifest.json’s pages (PR). And, when AMPState ampFirst is true, the amp page files were excluded by render.tsx. However, This PR seems to be removed that feature and caused the error.
It may be roughly solved the following way in _document.tsx.
before:
const files: DocumentFiles = getDocumentFiles(
this.context.buildManifest,
this.context.__NEXT_DATA__.page
)
after:
const files: DocumentFiles = inAmpMode ? {
sharedFiles: [],
pageFiles: [],
allFiles: [],
} : getDocumentFiles(
this.context.buildManifest,
this.context.__NEXT_DATA__.page
)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:25 (5 by maintainers)
Top Results From Across the Web
Dec 28, 2020
Anybody has/had this error Could not find files for /xxx in .next/build-manifest.json using #nextjs ?? it only happens on after building the ...
Read more >Error: EACCES: permission denied - node.js
If I run it with sudo, it gets installed inside ~/node_modules folder. drwxrwxr-x is the file permission of existing folder. I can't figure...
Read more >angular/angular - Gitter
We're using lazy loading and webpack. What appears to be happening is that the call to load the first lazy-loaded module are failing...
Read more >make app from next js Code Example
E: The repository 'http://ppa.launchpad.net/certbot/certbot/ubuntu hirsute Release' does not have a Release file. ... You are running `create- ...
Read more >UForge AppCenter User Documentation
Using an appliance template, the user can generate machine images in ... When you log in to the UForge Portal, the first page...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m having this issue with next v11.0.1
Does anyone review it?