rsnext/packages/next
Shu Ding 84531c5301
Add special error message for class component in server component (#44265)
This PR adjusts the error message so it's more accurate and makes more sense. Current error:

> You're importing a component that needs Component.

New:

> You’re importing a class component.

NEXT-317

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-12-24 14:18:34 +00:00
..
bin Add event for dev process stop (#42255) 2022-10-31 12:19:22 -07:00
build Add special error message for class component in server component (#44265) 2022-12-24 14:18:34 +00:00
bundles refactor: split up CONTRIBUTING.md (#40515) 2022-09-16 14:54:58 -07:00
cli Update config validation for latest turbopack changes (#44223) 2022-12-21 14:46:18 -06:00
client Exclude srcset from svg image (#44308) 2022-12-23 16:57:16 +00:00
compat next/compat/router (#42502) 2022-11-07 18:16:28 +00:00
compiled Bump @vercel/nft@0.22.6 (#44193) 2022-12-20 13:41:50 -08:00
export feat: enables 'edge' as a possible runtime for API routes (#44045) 2022-12-15 10:08:03 +01:00
font @next/font return types (#42753) 2022-11-10 08:56:27 -08:00
image-types
legacy BREAKING CHANGE: Rename next/image to next/legacy/image & rename next/future/image to next/image (#41399) 2022-10-14 01:59:22 +00:00
lib Honour distDir in type generation (#44207) 2022-12-21 16:01:59 +01:00
pages fix(ts): relax AppProps to not require generic (#41264) 2022-10-07 14:59:32 -07:00
server Fix next/image 404 when basePath and trailingSlash defined (#44312) 2022-12-23 23:04:26 +00:00
shared/lib Exclude srcset from svg image (#44308) 2022-12-23 16:57:16 +00:00
telemetry Move modularizeImports out of experimental (#44240) 2022-12-21 21:44:35 +01:00
trace Add tracing for testing tools (#44046) 2022-12-16 09:58:04 +01:00
types feat: enables 'edge' as a possible runtime for API routes (#44045) 2022-12-15 10:08:03 +01:00
amp.d.ts
amp.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
app.d.ts
app.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
babel.d.ts
babel.js
client.d.ts
client.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
config.d.ts
config.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
constants.d.ts
constants.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
document.d.ts
document.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
dynamic.d.ts
dynamic.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
error.d.ts
error.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
head.d.ts
head.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
headers.d.ts Add exports for new router (#41368) 2022-10-13 09:13:39 +00:00
headers.js Add exports for new router (#41368) 2022-10-13 09:13:39 +00:00
image.d.ts
image.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
index.d.ts typing: upgrade styled-jsx to remove workaround in build script (#39408) 2022-08-09 17:10:33 +00:00
jest.d.ts
jest.js fix(#36534): enable interopClientDefaultExport for next/jest (#36824) 2022-05-11 13:13:13 -05:00
license.md
link.d.ts
link.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
navigation.d.ts Add exports for new router (#41368) 2022-10-13 09:13:39 +00:00
navigation.js Add exports for new router (#41368) 2022-10-13 09:13:39 +00:00
package.json v13.1.1 2022-12-24 10:30:43 +01:00
README.md docs(README): next.js logo with dark mode (#40223) 2022-09-13 16:39:52 +02:00
router.d.ts
router.js Alias all client, shared, pages dist assets for esm (#41034) 2022-09-29 21:24:04 +00:00
script.d.ts
script.js Alias next public api to esm on edge runtime (#42709) 2022-11-09 19:20:32 -08:00
server.d.ts Update @types/node to 14.14.31 (#41634) 2022-10-22 11:19:14 -07:00
server.js refactor: add named export in next/server (#39381) 2022-08-07 16:17:15 +00:00
taskfile-ncc.js
taskfile-swc.js Improve RSC plugin to provide better errors (#42435) 2022-11-23 17:26:38 -08:00
taskfile-watch.js Replace taskr.watch for core compilation (#44027) 2022-12-14 16:06:53 +01:00
taskfile.js Replace taskr.watch for core compilation (#44027) 2022-12-14 16:06:53 +01:00
tsconfig.json next/compat/router (#42502) 2022-11-07 18:16:28 +00:00

Next.js

Getting Started

Visit https://nextjs.org/learn to get started with Next.js.

Documentation

Visit https://nextjs.org/docs to view the full documentation.

Who is using Next.js?

Next.js is used by the world's leading companies. Check out the Next.js Showcase to learn more.

Community

The Next.js community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.

To chat with other community members you can join the Next.js Discord.

Our Code of Conduct applies to all Next.js community channels.

Contributing

Please see our contributing.md.

Good First Issues

We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.

Authors

Security

If you believe you have found a security vulnerability in Next.js, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email security@vercel.com to disclose any security vulnerabilities.

https://vercel.com/security