Skip to content

Commit

Permalink
Fix reading edge info for app paths (vercel#41163)
Browse files Browse the repository at this point in the history
This fixes the build failing due to attempting to read `edgeInfo` that
wasn't present from using the wrong key to look up the manifest entry.
Regression test added by enabling `experimental-edge` on a page that was
failing to be looked up.

Fixes: 
```sh
TypeError: Cannot read properties of undefined (reading 'files')
    at /Users/jj/dev/vercel/layouts-playground/node_modules/next/dist/build/utils.js:786:33
    at Span.traceAsyncFn (/Users/jj/dev/vercel/layouts-playground/node_modules/next/dist/trace/trace.js:79:26)
    at Object.isPageStatic (/Users/jj/dev/vercel/layouts-playground/node_modules/next/dist/build/utils.js:771:29)
```

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
  • Loading branch information
ijjk authored and BowlingX committed Oct 5, 2022
1 parent 046152e commit a36d698
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/build/index.ts
Expand Up @@ -1358,7 +1358,7 @@ export default async function build(
MIDDLEWARE_MANIFEST
))
const manifestKey =
pageType === 'pages' ? page : join(page, 'page')
pageType === 'pages' ? page : originalAppPath || ''

edgeInfo = manifest.functions[manifestKey]
}
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/app-dir/app/app/(rootonly)/dashboard/hello/page.js
Expand Up @@ -5,3 +5,7 @@ export default function HelloPage(props) {
</>
)
}

export const config = {
runtime: 'experimental-edge',
}

0 comments on commit a36d698

Please sign in to comment.