Skip to content

Commit

Permalink
Fix not found pages
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkirsz authored and sokra committed May 3, 2023
1 parent d29b58e commit 265460a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next-swc/crates/next-core/src/page_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,14 @@ async fn create_not_found_page_source(
let (page_asset, pathname) =
if let Some(not_found_page_asset) = get_not_found_page(pages_dir, page_extensions).await? {
// If a 404 page is defined, the pathname should be 404.
(not_found_page_asset, StringVc::cell("404".to_string()))
(not_found_page_asset, StringVc::cell("/404".to_string()))
} else {
(
// The error page asset must be within the context path so it can depend on the
// Next.js module.
next_asset("entry/error.tsx"),
// If no 404 page is defined, the pathname should be _error.
StringVc::cell("_error".to_string()),
StringVc::cell("/_error".to_string()),
)
};

Expand Down

0 comments on commit 265460a

Please sign in to comment.