loadModule import breaks in production build in Vite + Vue3 + TS

196 views Asked by At

I am using vue-3-sfc-loader along with Vite,Vue3 and TS. The problem is when I try to import it like:

import { loadModule } from "../node_modules/vue3-sfc-loader/dist/vue3-sfc-loader.esm.js";

It throws error that:

Could not find a declaration file for module '../node_modules/vue3-sfc-loader/dist/vue3-sfc-loader.esm.js'. 'c:/Users/ams/Desktop/form_ui/form_ui/node_modules/vue3-sfc-loader/dist/vue3-sfc-loader.esm.js' implicitly has an 'any' type.

This is not really a problem in development but it breaks my build. Has anybody else faced a similar problem or am I importing it wrong?

0

There are 0 answers