Commit 93af1eb0 authored by Tim Neutkens's avatar Tim Neutkens

Fix issue

parent 56e94bd2
...@@ -2988,10 +2988,8 @@ export default async function build( ...@@ -2988,10 +2988,8 @@ export default async function build(
} }
} }
if (isSsg) { // remove non-locale prefixed variant from defaultMap
// remove non-locale prefixed variant from defaultMap delete defaultMap[page]
delete defaultMap[page]
}
} }
} }
......
...@@ -97,6 +97,21 @@ describe('i18n Support', () => { ...@@ -97,6 +97,21 @@ describe('i18n Support', () => {
expect(manifest[`/${locale}/500`]).toBe(`pages/${locale}/500.html`) expect(manifest[`/${locale}/500`]).toBe(`pages/${locale}/500.html`)
} }
}) })
it('should not have non-locale-prefixed HTML files for auto-static pages', async () => {
const pagesDir = join(appDir, '.next/server/pages')
// auto-export is a non-SSG auto-static page; only locale-prefixed
// variants should exist in server/pages/ (e.g. en-US/auto-export.html).
// A bare auto-export.html would be an orphan that can interfere with routing.
expect(await fs.pathExists(join(pagesDir, 'auto-export.html'))).toBe(
false
)
for (const locale of locales) {
expect(
await fs.pathExists(join(pagesDir, locale, 'auto-export.html'))
).toBe(true)
}
})
} }
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment