Comments (6)
These files are generated automatically on the .svelte-kit/types
folder as part of the npm lifecycle. I believe you can force them to be generated using npx svelte-kit sync
(docs). I believe this may solve your issue.
However, after they are generated, I'm getting another issue on svelte files when trying to import ./$types
- Cannot resolve file '$types'
It is working on VSCode, and it is also working when the import is on a Typescript file. The error only shows on the script tag of svelte files when running WebStorm
from svelte-intellij.
Seems this is unrelated to the plugin, but a Webstorm issue.
from svelte-intellij.
from svelte-intellij.
I'll adapt this issue, I was indeed making a mistake myself. However, I am having the same issue as you, with ./$types
unknown.
One to investigate, I am also having some issues with duplicate code. But that was fixed by marking the .svelte-kit
folder excluded.
from svelte-intellij.
I was facing similar issues. I changed my tsconfig.json
to include files from root
dir. That seems to have fixed the import of ./$types
. However, in +page.svelte
file, while it correctly imports PageData
type, data
variable still stays untyped.
Here's the screenshot of my setup.
from svelte-intellij.
@martinbeentjes do you know if there is a separate issue we can follow for the underlying Jetbrains / Webstorm problem here?
from svelte-intellij.
Related Issues (20)
- Generated types dir is not recognized in Svelte compoenents HOT 6
- Update SvelteJSReferenceExpressionResolver for 223 intellij branch HOT 1
- Comment with Line Comment broken for <script> section of .svelte files HOT 3
- Support NPM Workspaces for "Go to Declaration" HOT 1
- Add support for `context="module"` HOT 2
- Add support for @const HOT 1
- delete is not highlighted as a keyword in "<script>" block HOT 3
- Support for "endpoints" tool window integration HOT 1
- Auto-import does not emit `import type` for types HOT 1
- "Rename" refactoring HOT 1
- destructed exports are not suggested HOT 1
- typescript declarations not working correctly for derived stores. HOT 1
- Unresolved variable for store when using TypeScript HOT 2
- No errors on missing 'type' imports HOT 2
- type errors not showing on component props HOT 2
- Exported functions from initialized components are "unresolved" HOT 4
- `typeof` not hinted/colored in Svelte files HOT 1
- Importing files with extension .js instead of .ts HOT 3
- Update on plugin release schedule HOT 4
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 svelte-intellij.