You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/main.ts:5:19 - error TS7016: Could not find a declaration file for module 'piscina-locks'. '$HOME/code/temp/vue-project/node_modules/piscina-locks/dist/esm-wrapper.mjs' implicitly has an 'any' type.
There are types at '$HOME/code/temp/vue-project/node_modules/piscina-locks/dist/lib/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'piscina-locks' library may need to update its package.json or typings.
5 import locks from 'piscina-locks'
Possible solution
It looks like the types line in package.json might also need to be in the exports spec, but I'm out of my depth here.
Workaround
Use // @ts-expect-error to ignore this particular error until this issue is resolved.
MRE
# yarn create vue# some prompts translated from French, so may not line up exactly with what you see
✔ Name of project: … vue-project
✔ Add TypeScript? … Yes
✔ Add JSX support? … No
✔ Add Vue Router…? … No
✔ Add Pinia? … Yes
✔ Add Vitest? … Yes
✔ Add e2e test library? › No
✔ Add ESLint? … Yes
✔ Add Prettier? … Yes
✔ Add the extension Vue DevTools 7? (experimental) … No
# cd vue-project# yarn add -D piscina-locks# edit src/main.ts# nl !$
1 import './assets/main.css'
2 import { createApp } from 'vue'
3 import { createPinia } from 'pinia'
4 import locks from 'piscina-locks'
5 import App from './App.vue'
6 const app = createApp(App)
7 app.use(createPinia())
8 app.mount('#app')
# yarn build# ^--- this is where the compiler error shows up
Here are the various tsconfig files added to the MRE, in case that helps:
Compiler Error
Possible solution
It looks like the
types
line inpackage.json
might also need to be in theexports
spec, but I'm out of my depth here.Workaround
Use
// @ts-expect-error
to ignore this particular error until this issue is resolved.MRE
Here are the various tsconfig files added to the MRE, in case that helps:
The text was updated successfully, but these errors were encountered: