Giter VIP home page Giter VIP logo

Comments (6)

MFerraz avatar MFerraz commented on July 30, 2024 2

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.

martinbeentjes avatar martinbeentjes commented on July 30, 2024 1

Seems this is unrelated to the plugin, but a Webstorm issue.

from svelte-intellij.

martinbeentjes avatar martinbeentjes commented on July 30, 2024 1

https://youtrack.jetbrains.com/issue/WEB-57119/rootDirs-specified-in-tsconfigjson-not-respected-when-resolving-imports-in-svelte-files

from svelte-intellij.

martinbeentjes avatar martinbeentjes commented on July 30, 2024

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.

bhvngt avatar bhvngt commented on July 30, 2024

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.

image

from svelte-intellij.

dennisjlee avatar dennisjlee commented on July 30, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.