Skip to content
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

Fix unresolved reference to baklavajs-core types #212

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

hborchardt
Copy link
Contributor

Hello,

Thanks a lot for building this!

After upgrading typescript to 4.7 and disabling the "skipLibCheck": true setting in the tsconfig.json of one of my projects, I was greeted with the following complaint by typescript:

Error: node_modules/@baklavajs/plugin-renderer-vue/dist/baklavajs-plugin-renderer-vue/src/components/Editor.vue.d.ts:42:34 - error TS2307: Cannot find module 'packages/baklavajs-core/types/node' or its corresponding type declarations.

42     get nodes(): readonly import("packages/baklavajs-core/types/node").INode[];
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@baklavajs/plugin-renderer-vue/dist/baklavajs-plugin-renderer-vue/src/components/Editor.vue.d.ts:43:40 - error TS2307: Cannot find module 'packages/baklavajs-core/types/connection' or its corresponding type declarations.

43     get connections(): readonly import("packages/baklavajs-core/types/connection").IConnection[];
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I don't fully understand how the Editor.vue.d.ts file is generated during the build process, but I could find a way to satisfy the compiler by explicitly setting the return type of the getters in question, and importing them relatively, as is done with the other types from the baklavajs-core/types folder.

Running the build command on my system now produces a version of the library that the compiler is happy with.

Typescript complained that the type in the generated .d.ts file could
not be found when it imports an absolute path from the `packages` directory.

Explicitly specify and import the return types of the functions in
question.
@newcat
Copy link
Owner

newcat commented Sep 14, 2022

Interesting and kinda weird 😄 Thanks for the PR!

@newcat newcat merged commit 050ed97 into newcat:master Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants