Comments (6)
FYI, if you're willing to be a bit heavy-handed, you can disable this warning under the Svelte extension for VSCode:
This will at least suppress the warning and let you use the editor without red squigglies. @dummdidumm linked the other places you may have to suppress it.
from sveltekit-autoimport.
Isn't this by design? Nothing is informing the language service about the imports so it complains.
unplugin-vue-components
solves this by generating a components.d.ts
file that informs the language service about the components.
It looks like this:
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/vue-next/pull/3399
declare module 'vue' {
export interface GlobalComponents {
Alert: typeof import('./components/Alert.vue')['default']
Alerts: typeof import('./components/Alerts.vue')['default']
Chart: typeof import('./components/Chart.vue')['default'];
ChartExample: typeof import('./components/ChartExample.vue')['default']
Donut: typeof import('./components/Donut.vue')['default'];
FaSolidBolt: typeof import('~icons/fa-solid/bolt')['default']
FaSolidCheckCircle: typeof import('~icons/fa-solid/check-circle')['default']
FaSolidExclamationCircle: typeof import('~icons/fa-solid/exclamation-circle')['default']
FaSolidInfoCircle: typeof import('~icons/fa-solid/info-circle')['default']
FaSolidPlug: typeof import('~icons/fa-solid/plug')['default']
FaSolidSlidersH: typeof import('~icons/fa-solid/sliders-h')['default']
FaSolidTimesCircle: typeof import('~icons/fa-solid/times-circle')['default']
Logo: typeof import('./components/Logo.vue')['default']
LogView: typeof import('./components/LogView.vue')['default']
}
}
export { }
from sveltekit-autoimport.
Are you using VSCode? It seems the warning message comes from one of its plugins
from sveltekit-autoimport.
@felixheidecke did you get this figured out? I'm still seeing this regardless of what I do in my d.ts file
from sveltekit-autoimport.
The d.ts file will silence errors by typescript that it cannot find the module. The mentioned warning here is from the Svelte compiler, which cannot be silenced like this. There currently isn't a way to silence a warning across svelte-check, the ide and Kit through a single setting, but they all have ways to silence this on their own (see options of the extension/svelte-check readme/vite-plugin-svelte readme)
from sveltekit-autoimport.
This sole issue is the only reason I avoid using this library.
You won't believe how many times I've been allured into using Nuxt 3 instead, just for this feature.
from sveltekit-autoimport.
Related Issues (20)
- How to auto-import from component library in node_modules? HOT 10
- Should it better be called "sveltekit-autoimport"?
- Possible support for .js-files by wildcard? HOT 6
- Import Fails with SCSS nesting HOT 6
- TS let statement breaking import HOT 3
- Broken for sveltekit version >= 1.0.0-next.346
- Doesn't auto-import for svelte auto-subscriptions
- Doesn't auto-import for Object indented Components
- Support for auto-import inside <script context="module">
- Error: Failed to parse source for import analysis because the content contains invalid JS syntax. HOT 5
- Make it compatible with SK version >= 1.0.0-next.359 HOT 2
- VSCode support HOT 8
- Typescript Support
- Error with auto-import and mdsvex Layout component.
- Is it possible to auto import 'svelte/transition'? HOT 6
- How can I make this work with MDsveX? HOT 34
- Nested Components HOT 2
- Import Broken When lang="ts HOT 9
- Importing '$app/stores' : ['page'] brings about crbug HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sveltekit-autoimport.