-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
ERR_UNSUPPORTED_DIR_IMPORT when using MDXContent or useMDXComponent #277
Comments
Could you provide more details? Which package manager do you use? Is your application a module ( |
@sdorra I could have sworn I responded here a few minutes ago but now it's gone. Did you remove the comment? |
@rossmeissl No, I am looking at the ticket for the first time today |
@sdorra OK strange let me try again:
|
I've tried to reproduce the issue: https://github.com/sdorra/cc-issue-277 But it works as expected. Can you check if there are any differences between my sample and yours? |
My directory structure uses |
@rossmeissl I've updated the sample to use the pages router with a |
Unfortunately no it's our monorepo but let me see if I can extract just enough to repro . . . |
@sdorra sent you an email. Let me know if I can help further! |
@rossmeissl i was able to reproduce the issue. I can even reproduce it with my repository. When I navigate to an article and then press refresh, I get the error. The error seems to occur only in the Pages Router. I will try to fix it. |
Use full path to mdx-bundler client include index.js, instead of only the directory. This should fix the usage of mdx package in next.js pages router. Closes: #277
Thanks @sdorra ! |
@rossmeissl the fix is not yet released. Have you tested the fix with the preview release? If not can you please test if it fixes your problem? You only have to install the packages as described in the following comment: |
Actually, hmm, this appears to have just emerged unrelated to this PR |
It works! (I had previously told Next to transpile |
@sdorra shall I close this? |
If I use
mdx-bundler
'sgetMDXComponent
mechanism directly, the problem goes away.The text was updated successfully, but these errors were encountered: