-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Package.json's exports field causes issues #147
Comments
Same issue with |
Well that's interesting, but kinda defeat the purpose of exports fields 🤔 |
I just tried with |
@martpie it does not seem fixed on our end. The two packages we have problems with are Is there a quick workaround for this issue specifically? Thanks for your time! |
I have the same problem with the same packages and versions.
@martpie with what versions did you have it work? |
I used (at the time) the latest next + ntm, and I could use nanoid with Do you have a reproduction for me? |
nothing special Next - 10.0.6 |
The problem seems to be coming from upstream and |
@martpie Thanks a lot for investigating! In the meantime, is there any short term fix my team can apply? Otherwise we would have to wait for the maintainers of |
This probably has to do with NPM 7? |
no, nothing to do with |
Can anyone confirm me it's fixed in |
it works now, no error during compilation in console. |
@martpie @andrekorolev it does unfortunately not fix the underlying problem: |
Can you output here the debug log? (see README) |
@martpie sure, here you go: This is the output:
|
Well, when I do a |
Still testing a few things on my side. |
@martpie I am sorry to bother you again, but your example will work of course, since the page you show in the screenshot is rendered on the server. Have you actually checked if the client side hydration works in your example? Basically what happens if you call |
The page is re-hydrated on the browser (which causes a mismatch because nanoid will generate another string). So yeah, nanoid is called on the browser as well. |
Hi @martpie, after some more digging and debugging, we have found the offending package. It is Could you maybe take the time and verify that? Thanks so much! |
This is not const withTM = require('next-transpile-modules')(['nanoid']); only So you'd need to manually add |
@martpie Sorry, forgot to mention, that I DO have Still it does not get transpiled. EDIT: This is the debug log for this time.
|
Can you paste here the content of |
@martpie Sure, here you go: |
|
@Algram can you open a separate issue with a reproduction/piece of code that should be working but is not, etc? So we avoid polluting this thread. |
Is there something wrong with
enhanced-resolve
and it cannot detect ESM viaexports
?The text was updated successfully, but these errors were encountered: