Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api changes #267

Open
anothergituser opened this issue Dec 24, 2023 · 8 comments
Open

api changes #267

anothergituser opened this issue Dec 24, 2023 · 8 comments

Comments

@anothergituser
Copy link

Hello,

In previous versions this worked "@iconify/svelte/dist/Icon.svelte" and now only this works "@iconify/svelte"
What changed and how can i keep using the old style import?

Thanks

@cyberalien
Copy link
Member

Try installing @iconify/svelte@next

@anothergituser
Copy link
Author

anothergituser commented Dec 24, 2023

no luck, i tried 3.1.6 and 4.0.0-beta.2 and i get the same error. Now i'm back on the original version in my project which is 2.2.1

    Error: Cannot import "@iconify/svelte/dist/Icon.svelte": no matched export path was found in "pkg_name/package.json".

so yeah, i have no idea what happened like a week ago when this error first appeared ..
The file Icon.svelte exists in the correct path so maybe something in the api changed

@cyberalien
Copy link
Member

Should be fixed in 4.0.0-beta.3

@anothergituser
Copy link
Author

is 4.0.0-beta.3 missing index.js? i'm having trouble importing from https://cdn.jsdelivr.net/npm/@iconify/[email protected]/dist/

@cyberalien
Copy link
Member

It no longer exists because it is not needed. Svelte uses .svelte file, that .js file was compiled for very old version of Svelte.

Correct usage is to import @iconify/svelte, which is pointing to dist/Icon.svelte.

@cyberalien
Copy link
Member

Completely forgot about Svelte component. New version has been published as beta for almost half a year now.

Just published it as stable version 4.0.0. No changes since version 4.0.0-beta.3.

Importing from /dist/ won't work, newer versions of Svelte supports only .svelte files when importing components, not pre-compiled .js files. And by "newer" I mean versions released in last few years.

Imports that work: @iconify/svelte, @iconify/svelte/dist/Icon.svelte, @iconify/svelte/dist/OfflineIcon.svelte.

Importing from @iconify/svelte points to @iconify/svelte/dist/Icon.svelte.

@JoaoVictorLouro
Copy link

@cyberalien not sure what changed between v3 and v4... but i cant install v4 under pnpm:

 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In : "@iconify/types@workspace:^" is in the dependencies but no package named "@iconify/types" is present in the workspace
This error happened while installing the dependencies of @iconify/[email protected]

tried with pnpm v8 and v9 (8.14.3, 8.15.5, 8.15.7, 9.0.0, 9.0.6)

You might want to check for issues as the package also shows 0 downloads within npm

image

@cyberalien
Copy link
Member

Sorry about that. Looks like I've published using npm instead of pnpm by accident. Re-published as 4.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants