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

Adding ?sprite to the module doesn't work #38

Closed
ahmadalfy opened this issue Oct 19, 2018 · 2 comments
Closed

Adding ?sprite to the module doesn't work #38

ahmadalfy opened this issue Oct 19, 2018 · 2 comments

Comments

@ahmadalfy
Copy link

Hello,

My ESLint is complaining when I try to import a file as an svg sprite as follow:

import idea from '../static/images/icons/idea.svg?sprite';

I added comments to ignore the error and it worked. When I tried to test the component with jest it failed to import the file.

@cyrilwanner
Copy link
Owner

Hi @ahmadalfy

This probably comes from jest not knowing our webpack config (where we define these resource queries). I just googled a bit and there are still open issues and pull requests for jest to solve this issue (looks like a lot of devs have this problem).
I didn't try it out, but some people are having success with this config option to simply ignore all required images: https://jestjs.io/docs/en/configuration#modulepathignorepatterns-array-string
There are probably also other settings which could help you.

@ahmadalfy
Copy link
Author

@cyrilwanner Thank you, closing it as it is not related here and will check your suggestion and update you. Thanks again

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