-
Notifications
You must be signed in to change notification settings - Fork 144
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
Preact: Can't resolve 'react/jsx-runtime.js' #237
Comments
Thanks for the report! We haven't explicitly tested preact support, so not unexpected that we might have an issue here. If you'd be willing to create a minimal reproduction I'd be happy to dig in further! |
Thanks! Test case: https://github.com/eostrom/next-mdx-remote-237-test-case |
Also: I dug into the second error a little. Based on the stack trace and the shape of the minified code, I suspect it's coming from this part of Preact's function getHookState(index, type) {
if (options._hook) {
options._hook(currentComponent, index, currentHook || type); // <- this line! the __h stands for _hook!
} Google found me a couple of similar errors in other projects, but that's as far in over my head as I wanted to get at this point. Let me know if you have trouble reproducing the bug, or if I can be of any help. |
Just thought I'd pop in as I'm having issues with the Very similar build error:
|
This temporary webpack: (config) => {
config.resolve.alias = {
...config.resolve.alias,
// fixes next-mdx-remote: Package path ./jsx-runtime.js is not exported from package react
// https://github.com/hashicorp/next-mdx-remote/issues/237
"react/jsx-runtime.js": require.resolve("react/jsx-runtime"),
};
} See Next.js documentation on adding webpack aliases here or the fix in my repo. :) |
Congratulations on the upgrade to MDX 2! I'm excited to try it. Unfortunately I got this error when rendering some MDX with next-mdx-remote 4.0.0, Next 12.1.0, and Preact 10.6.6:
Removing the
.js
from this line indist/index.js
(and presumablysrc/index.tsx
) seems to fix it:But now I'm getting a different error:
That line doesn't look like it should cause any problems:
I'll try to come back to it later and debug, submit a PR, or provide a minimal test case, but I thought I'd place a marker here in the meanwhile, in case anyone else is running into the same problem – or, in case it's working just fine for everyone else and the problem is I've misconfigured something.
The text was updated successfully, but these errors were encountered: