vue3-sfc-loader icon indicating copy to clipboard operation
vue3-sfc-loader copied to clipboard

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

Open isaeedahmed opened this issue 2 years ago • 1 comments
trafficstars

Describe the bug While trying to import loadModule as show below:

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

TS starts complaining and the following error is thrown while building the application:

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

To Reproduce

Just try to import as above and the error should be reproduced. One question would be that am I importing it wrong? As far as I can see in examples it was supposed to be imported like this.

Versions

  • Browser (name & version): Chrome
  • vue3-sfc-loader: 0.8.4

isaeedahmed avatar Jan 26 '23 13:01 isaeedahmed

Try using import { loadModule } from "vue3-sfc-loader";.

lukemovement avatar May 19 '24 13:05 lukemovement