Closed webJose closed 1 year ago
I had the same issue and found a solution through stackoverflow. This seems to be a Typescript behavior as described in the docs here.
The fix seems to be to add a reference to the types within the exports
property as well:
"module": "dist/esm/single-spa-vue.js",
"exports": {
".": {
"types": "./types/single-spa-vue.d.ts", // <-- Adding this fixes the issue
"import": "./dist/esm/single-spa-vue.js",
"require": "./dist/umd/single-spa-vue.js"
},
I tried it locally and it seems to work as expected. I'll create a pull request for it.
Note that I am using ESM and haven't tested for commonjs.
I am getting the following error in a Vue + Vite project:
This error prevents building the application.
I found a workaround:
typings
, orcustom-typings
.single-spa-vue
.node_modules/single-spa-vue/types/single-spa-vue.d.ts
and rename it toindex.d.ts
.tsconfig.json
file to include thepaths
property undercompilerOptions
to include this custom typings folder. Something like this:Unrelated question: Is this project abandoned? No updates for 2 years.