Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakobo/next-allowed-compile-rsc
Reproduction repository demonstrating next lint cannot catch coding errors with RSC
https://github.com/jakobo/next-allowed-compile-rsc
Last synced: about 20 hours ago
JSON representation
Reproduction repository demonstrating next lint cannot catch coding errors with RSC
- Host: GitHub
- URL: https://github.com/jakobo/next-allowed-compile-rsc
- Owner: jakobo
- Created: 2023-12-22T22:33:46.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2023-12-22T22:58:10.000Z (11 months ago)
- Last Synced: 2023-12-22T23:29:08.957Z (11 months ago)
- Language: TypeScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Changes In Repository
* A `next lint` command was added to the `package.json`
* `.eslintrc.json` was created with the strictest mode possible* `client.tsx` was created with a client-only declaration without the `use client` directive
* `page.tsx` was modified to call `client.tsx`
* An identical structure was created under the `[id]` route segment.# Expected
* Commenting out both `use client` directives and running `next lint` should generate an error in both `client.tsx` for using client-only declarations without the `use client` directive
* `next build` should fail the build in both scenarios# Actual
* No errors are generated on lint
* As committed, `next build` allows the build, which results in a `500` error accessing the page via `pnpm start --port 3000` and visiting `localhost:3000/a````
[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
digest: '243405769'
}
``````
Error: Event handlers cannot be passed to Client Component props.
{src: ..., onError: function, alt: ...}
^^^^^^^^
If you need interactivity, consider converting part of this to a Client Component.
at /home/jakobo/code/nextjs/allowed-compile-rsc/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142759
at Object.toJSON (/home/jakobo/code/nextjs/allowed-compile-rsc/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:143612)
at stringify ()
at eE (/home/jakobo/code/nextjs/allowed-compile-rsc/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131997)
at eR (/home/jakobo/code/nextjs/allowed-compile-rsc/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132440)
at Timeout._onTimeout (/home/jakobo/code/nextjs/allowed-compile-rsc/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:129220)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7)
```
This is a [Next.js](https://nextjs.org/) template to use when reporting a [bug in the Next.js repository](https://github.com/vercel/next.js/issues) with the `app/` directory.
## Getting Started
These are the steps you should follow when creating a bug report:
- Bug reports must be verified against the `next@canary` release. The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces before opening a new issue. Issues not verified against `next@canary` will be closed after 30 days.
- Make sure your issue is not a duplicate. Use the [GitHub issue search](https://github.com/vercel/next.js/issues) to see if there is already an open issue that matches yours. If that is the case, upvoting the other issue's first comment is desireable as we often prioritize issues based on the number of votes they receive. Note: Adding a "+1" or "same issue" comment without adding more context about the issue should be avoided. If you only find closed related issues, you can link to them using the issue number and `#`, eg.: `I found this related issue: #3000`.
- If you think the issue is not in Next.js, the best place to ask for help is our [Discord community](https://nextjs.org/discord) or [GitHub discussions](https://github.com/vercel/next.js/discussions). Our community is welcoming and can often answer a project-related question faster than the Next.js core team.
- Make the reproduction as minimal as possible. Try to exclude any code that does not help reproducing the issue. E.g. if you experience problems with Routing, including ESLint configurations or API routes aren't necessary. The less lines of code is to read through, the easier it is for the Next.js team to investigate. It may also help catching bugs in your codebase before publishing an issue.
- Don't forget to create a new repository on GitHub and make it public so that anyone can view it and reproduce it.## How to use this template
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
```bash
npx create-next-app --example reproduction-template reproduction-app
``````bash
yarn create next-app --example reproduction-template reproduction-app
``````bash
pnpm create next-app --example reproduction-template reproduction-app
```## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc) - a video tutorial by Lee Robinson
- [Triaging in the Next.js repository](https://github.com/vercel/next.js/blob/canary/contributing.md#triaging) - how we work on issues
- [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) - Edit this repository on CodeSandboxYou can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deployment
If your reproduction needs to be deployed, the easiest way is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.