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

doesn't work with webpack when using named imports #940

Closed
woss opened this issue Dec 16, 2022 · 2 comments
Closed

doesn't work with webpack when using named imports #940

woss opened this issue Dec 16, 2022 · 2 comments

Comments

@woss
Copy link

woss commented Dec 16, 2022

the type is set to module, which means that the imports must be valid ESM, end with the .js which the icons/index.js does not have, and this breaks imports in webpack.

Here is the screenshot of the portion of the errors
image

@RobBrazier
Copy link
Owner

RobBrazier commented Dec 16, 2022

Please can you provide a snippet of the code you're using?

Can you try using https://docs.robbrazier.com/svelte-awesome/icons instead of importing from index.js and see if that works better?

i.e. import wpexplorer from 'svelte-awesome/icons/wpexplorer';

@woss
Copy link
Author

woss commented Dec 16, 2022

yes, that worked, i just tried then i saw your message.

Thing is that the valid ESM requires the .js, you can read about it here https://nodejs.org/api/esm.html#import-specifiers

@woss woss changed the title doesn't work with webpack doesn't work with webpack when using named imports Dec 16, 2022
@woss woss closed this as completed Dec 19, 2022
@woss woss reopened this Dec 19, 2022
@woss woss closed this as completed Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants