Files
vercel__next.js/test/development/app-dir/error-overlay/async-client-component/async-client-component.test.ts
Jiwon Choi d7aa66c345 Remove generated error codes (#97687)
### Why?

Should come up with better solution that does not block PRs with git
conflict

x-ref:
https://vercel.slack.com/archives/C02CDC2ALJH/p1785263902728189?thread_ts=1785263687.502649&cid=C02CDC2ALJH

### How?

- Delete `errors.json`, the error-code SWC plugin, generated WASM, merge
driver, and validation/build tooling.
- Stop attaching error codes to server-rendering digests, redboxes, and
telemetry; native `Error.code` and `Error.name` remain available where
applicable.
- Remove the development-overlay error feedback UI, middleware, and
telemetry event that depended on stable codes.
- Update fixtures, snapshots, and guidance for code-free errors and
numeric-only digests.

<!-- NEXT_JS_LLM -->
2026-08-21 22:45:12 +02:00

45 lines
1.6 KiB
TypeScript

/* eslint-env jest */
import { nextTestSetup } from 'e2e-utils'
import { waitForNoRedbox } from 'next-test-utils'
describe('app-dir - async-client-component', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('app router client component async module', async () => {
const browser = await next.browser('/client')
// There is no stack since this error is issued from the owner
// which is a Next.js Component.
// Ideally, it would be issued from the async Component instead but that's
// harder to implement.
await expect(browser).toDisplayCollapsedRedbox(`
[
{
"description": "<Page> is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding \`'use client'\` to a module that was originally written for the server.",
"environmentLabel": null,
"label": "Console Error",
"source": null,
"stack": [],
},
{
"description": "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.",
"environmentLabel": null,
"label": "Console Error",
"source": null,
"stack": [],
},
]
`)
})
it('app router server component async module', async () => {
const browser = await next.browser('/server')
await waitForNoRedbox(browser)
expect(await browser.elementByCss('#app-router-value').text()).toBe('hello')
})
})