Giter Site home page Giter Site logo

Comments (9)

cyberalien avatar cyberalien commented on May 28, 2024

I have similar code in this repository in SvelteKit demo: https://github.com/iconify/iconify/blob/main/components-demo/sveltekit-demo/src/lib/header/Header.svelte

But I'm not seeing any errors.

Can you create a basic reproduction?

from iconify.

userquin avatar userquin commented on May 28, 2024

try importing @iconify/svelte in src/app.d.ts: check for example unplugin-icons Svelte usage in SvelteKit, Frameworks section

from iconify.

PavelJacoboGonzalez avatar PavelJacoboGonzalez commented on May 28, 2024

Hello, Thanks so much for the feed back. I've installed sveltekit from scratch, I install Iconify and it's still happening.
I've created this repo. It's actually happening here: https://github.com/PavelJacoboGonzalez/iconify_test/tree/development

At first I thought it was due to Svelte for Vscode extension, but not 100% sure about it.

Thanks for feedback

Regards

from iconify.

userquin avatar userquin commented on May 28, 2024

can you add import '@iconify/svelte'; before L3 and restart VSCode window?: https://github.com/PavelJacoboGonzalez/iconify_test/blob/development/src/app.d.ts#L3

https://github.com/unplugin/unplugin-icons/blob/main/examples/sveltekit/src/app.d.ts#L1

from iconify.

userquin avatar userquin commented on May 28, 2024

@cyberalien Svelte 4 has changed the defintiion, you're using Svelte 3, for Svelte 4 you need to change to this one:
https://github.com/unplugin/unplugin-icons/blob/main/types/svelte4.d.ts#L9-L10

from iconify.

cyberalien avatar cyberalien commented on May 28, 2024

Thanks! So I need to release new package for Svelte 4... on it.

from iconify.

cyberalien avatar cyberalien commented on May 28, 2024

Try @iconify/svelte@next, which should install version 4.0.0-beta.2

Seems to work correctly in my tests with latest Svelte 4. I'm in process of doing more tests, but most likely will finish testing only tomorrow.

from iconify.

userquin avatar userquin commented on May 28, 2024

@PavelJacoboGonzalez you need to use bundler module resolution, tested in your repro with @iconify/svelte@next and VSCode and Intellij (JetBrains) working with auto complete ("@iconfy/svelte": "next" then "yarn && yarn check" after updating tsconfig.json file):

imagen

imagen

imagen

from iconify.

PavelJacoboGonzalez avatar PavelJacoboGonzalez commented on May 28, 2024

Awesome. Working as @userquin suggested.

"module": "ESNext",
"moduleResolution": "Bundler"

Thanks so much for support.
Really appreciate
Regards

from iconify.

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.