-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Type imports broken in TypeScript's NodeNext mode (ESM support) #3488
Comments
Any chance that 2023 is the year of nodenext support in tiptap? 🙏 |
Any idea if it is possible to resolve this temporarily without creating patch packages as it seems to be an issue with every subpackage? |
We just copied the types we needed (for now).... 😅 |
@nickluger could you create a codesandbox running an example project that highlights the error you're describing? I tried it for now with an Vite app (since they also run on Would love to get this working soon. |
@bdbch I prepared a repository which should allow you to reproduce the problem, I also added some additional info/context to it's README: https://github.com/dziraf/tiptap-types-issue |
Thanks @dziraf, I started to work on a fix for this but I'd like to postpone it for the next version since I can't make sure my changes won't break other build processes right now. Need to test it a bit more. But I'll keep it on focus! |
Just saw there's an RC. Any chance this will still make 2.1.0? |
Potentially yes. Since this brings a lot of changes on how imports are made I just want to make sure the change to file extensions doesn't break the existing builds. in general if someone wants to pick up this issue to work on it feel free. Right now I'm a bit loaded with other things. |
With a hint, I could take a crack at it. My issue right now is I'm not super familiar with how people are using rollup to do this, and that seems to be the core build tool being used here. |
Actually it looks like just adding file endings to the imports fixes it. This should be harmless to add even for CJS users, since omitting them there is mostly stylistic (and maybe as a negative leans on the behavior of the resolver to choose the final path). I'll give that a try. |
I put up a #4001 — went with using eslint to enforce it. |
What’s the bug you are facing?
This used to work in
beta.199
:Now (
beta.204
) it shows theModule has no exported member
error.This could be due to this TS issue, meaning the
index.d.ts
exported by tiptap is using expressions likeexport * from './CommandManager';
, while it should beexport * from './CommandManager.js';
.I'm using:
"type": "module"
in mypackage.json
.4.9.3
.NodeNext
mode, as supposed to be used for ESM projects.Which browser was this experienced in? Are any special extensions installed?
This happens in TS.
How can we reproduce the bug on our side?
"type": "module"
in yourpackage.json
and"module": "NodeNext"
in yourtsconfig.json
.import type { JSONContent } from "@tiptap/core";
tsc
Can you provide a CodeSandbox?
No, that's in TS.
What did you expect to happen?
TS should resolve the type.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: