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
TS7016 compilation error - prosemirror-state/dist/index.js
implicitly has an any
type
#1456
Comments
Have you tried upgrading TypeScript to something more recent? I see you're using 4.6, which is two years old. |
@marijnh Thanks for your response. Following your suggestion I just tried again with the newer TypeScript versions:
Unfortunately it makes no difference, and they all fail with the same error as we are seeing with TypeScript 4.6.3 currently. |
I experimented with adding some compiler options in our project's
Obviously neither of these options are particularly desirable in a TypeScript project as they loosen the type checking performed by the compiler. I note that whilst the |
That seems unlikely, if you really have prosemirror-state version 1.4.3.
|
Thanks for that insight @marijnh, we are using Yarn instead of npm, but I was able to re-produce your results using the equivalent commands; that is reassuring! This has given me something to go on though... I note that if I run the following: nvm use 20
cd /tmp
git clone https://github.com/evolvedbinary/prosemirror-jdita.git test1
cd test1
git checkout test/unit-test-prosemirror
yarn install Then after that there are these two folders:
$ tree prosemirror-jdita/node_modules/prosemirror-state/dist
prosemirror-jdita/node_modules/prosemirror-state/dist
├── index.cjs
├── index.d.cts
├── index.d.ts
└── index.js NOTE: Only one of those two folders contains the If I then run
The fact that there is a So at this point I am wondering if there is something screwed up about our build settings in |
Yeah, that's yarn. I recommend not to use yarn, it creates weird trees with needlessly duplicated dependencies, which breaks this library (and loads way more code than you want to load). Recent npm versions are much better at this. |
@marijnh Thank you very much for your time and help. We finally diagnosed that our |
We are having some trouble using ProseMirror in our TypeScript project - evolvedbinary/prosemirror-jdita.
Our CI (https://app.circleci.com/pipelines/github/evolvedbinary/prosemirror-jdita/238/workflows/2e59929e-174d-447f-b4a5-ee373ebd8fd0/jobs/916) shows these errors when compiling:
Our
package.json
imports the following dependencies:I feel like it is unlikely that this is expected behaviour with ProseMirror and TypeScript, and more likely that we are doing something silly (apologies if that is the case).
I did ask in your Forum (7 days ago), also I also asked in the TypeScript Discord channel (6 days ago) but got no response from either. Sorry to also ask here, but it does seem like a technical issue, and it is really blocking us from moving forward.
Kindest regards, and thank you. Adam.
The text was updated successfully, but these errors were encountered: