Closed lunpessoa closed 7 months ago
@lunpessoa I've also had this issue. I think the types' exports may be a little crooked and don't work great with some TS configurations. I've found that only moduleResolution: node
more-or-less works out of the box; moduleResolution: bundler
gives the same error you've shared (likely because resolvePackageJsonExports
is true in this mode).
The TypeScript compiler is failing to locate the declaration file for the module '@gmap-vue/v3'. The error message indicates that the file 'project/node_modules/@gmap-vue/v3/dist/main.es.js' implicitly has an 'any' type, even though there are types available at 'node_modules/@gmap-vue/v3/dist/types/src/main.d.ts'.
As a workaround, I've managed to fix this issue by adding the types
entry to the package.json's exports:
diff --git a/node_modules/@gmap-vue/v3/package.json b/node_modules/@gmap-vue/v3/package.json
"exports": {
".": {
+ "types": "./dist/types/src/main.d.ts"
"import": "./dist/main.es.js",
"require": "./dist/main.umd.js",
"default": "./dist/main.es.js"
}
},
For the time being, I'm using patch-package; however, it would be nice to merge this into the repo.
A new version is coming soon, with breaking changes, but with a big improvement in the plugin API and its types 💪🏼.
Hi @lunpessoa and @basuneko, our new version has landed, could you test it (v 2.0.0)? also, you can find the main points on our new documentation site.
I'm going to close this but, if you find something wrong related to this ticket feel free to re-open it or open a new one if something new appears. Thank you.
What you try to do
I am attempting to integrate the @gmap-vue/v3 library into my TypeScript project to enable Google Maps functionality.
What is the problem
The TypeScript compiler is failing to locate the declaration file for the module '@gmap-vue/v3'. The error message indicates that the file 'project/node_modules/@gmap-vue/v3/dist/main.es.js' implicitly has an 'any' type, even though there are types available at 'node_modules/@gmap-vue/v3/dist/types/src/main.d.ts'.
What kind of things have you already treated
I have verified the correctness of the path specified in the "typings" field of the package.json. I have also updated TypeScript to the latest version, but the issue persists.
Steps to reproduce
To reproduce the issue:
OS
Mobile
Versions
Package manager
Plugin version