[Bug]: Jest does not recognise Vite suffixes applied to imports
Version
29
Steps to reproduce
With Vite we can decide how to import static assets: https://vitejs.dev/guide/assets . In particular: you can add specific suffixes to the imported file, like ?inline.
Jest 29 does not recognize those imports and throws an error saying that the file could not be found.
If I use a moduleMapper I can map the file to a stub, but existing transforms they do not work any longer..
Expected behavior
File should have been recognize and Jest should threat the suffix not as as part of the path, but instead as metadata or ignore it vcompletely. I should be able to use a transform if in order to treat svg as ReactComponent for example.
Actual behavior
Jest says that the file is not found, so the related transform is not applied
Additional context
No response
Environment
OS: Windows
Jest Version: 29
Node version: 18
you can use a custom resolver to strip query parameters. not sure if there are cleaner ways of doing it
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.