-
Notifications
You must be signed in to change notification settings - Fork 27.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
appDir: Module resolution error when using a RSC #45485
Comments
Quick workaround is to have |
Thanks for insight @shuding |
I looked deeper and the reason is actually that "use client"
import {
Callout,
CodeBlock,
createIFrameHandler,
createLinkHandler,
Doc,
Heading,
MarkMap,
RemirrorRenderer,
TextHandler,
} from "@remirror/react"; The error message from Next was wrong and it should be fixed in #45971. |
Closes #45485. Currently we always output the first error message from the compiler to avoid making the CLI noisy. However for RSC the first error can potentially be the consequence of another error which is the real cause. In #45485, the first error was `Attempted import error: 'includes' is not exported from '@remirror/core-helpers'` but it was actually caused by the failure of bundling a package `get-dom-document`. The package is one of the deps of another package, and then that package is a dep of `@remirror/core-helpers`. Everything in the dependency chain failed to import but we only shows the first one (probably the leaf), which makes it impossible to debug. This PR fixes it by throwing a special error when we notice that something is not bundle-able in RSC. And in the output process we prioritize RSC bundling and RSC errors first — as they are usually the cause of other errors. The new error message looks like this: <img width="981" alt="CleanShot-2023-02-16-8HUK7vAZ@2x" src="https://user-images.githubusercontent.com/3676859/219216666-7521ca52-68e0-41ed-9219-4d49535f5645.png"> And by applying that change the error will be resolved. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] 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)
@shuding can you point me a file which uses it |
@kasvith |
aha, thanks |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://github.com/kasvith/next13-remirror-react-renderer-error.git
To Reproduce
Describe the Bug
I want to render React Nodes with React Remirror Renderer(it doesn't load the Editor and produces React Nodes from a given JSON, similar to how MDX works)
So i wanted to use it as a Server Component,
This gives me a weird error like
But the
includes
from@remirror/core-helpers
is already an exported member.If i switch to
use client
, it works fine and renders contentExpected Behavior
To provide a better error or solve this if can
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: