Unverified Commit acd3b25e authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

remove amp error in app dir (#48620)

Follow up for #48489 

As config is dropped and we can only check server components previously.
We can remove it now
parent 1f6a45d2
......@@ -713,15 +713,6 @@ export async function renderToHTMLOrFlight(
`The default export of notFound is not a React Component in ${segment}`
)
}
if (
!isClientReference(layoutOrPageMod) &&
layoutOrPageMod?.config?.amp
) {
throw new Error(
'AMP is not supported in the app directory. If you need to use AMP it will continue to be supported in the pages directory.'
)
}
}
// Handle dynamic segment params.
......
/* eslint-env jest */
import path from 'path'
import { createNextDescribe, FileRef } from 'e2e-utils'
import { getRedboxDescription, hasRedbox } from 'next-test-utils'
// TODO: investigate this test flaking in CI
describe.skip('should skip for now', () => {
createNextDescribe(
'Error Overlay unsupported app features',
{
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
},
({ next }) => {
it('should show error exporting AMP config in app dir', async () => {
const browser = await next.browser('/')
// Add AMP export
await next.patchFile(
'app/page.js',
`
export const config = { amp: true }
import Component from '../index'
export default function Page() {
return <Component />
}
`
)
expect(await hasRedbox(browser, true)).toBe(true)
expect(await getRedboxDescription(browser)).toInclude(
'AMP is not supported in the app directory. If you need to use AMP it will continue to be supported in the pages directory.'
)
})
}
)
})
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