Hi there! I am currently rewriting my application (Nextjs. 15, Pages Router) to App Router. With this rewrite, a lot of directory structure changed and probably other things. However, I did not really touch the trigger tasks in terms of functionality.
When I try to start the trigger dev with npx [email protected] dev the build fails:
✘ [ERROR] No loader is configured for ".svg" files: assets/images/icons/warning.svg
components/ui/Icon/Icon.tsx:62:20:
62 │ import warning from '../../../assets/images/icons/warning.svg'
// ...
X Error: Failed to build
node:internal/process/promises:391
triggerUncaughtException(err, true /* fromPromise */);
^
Error: Failed to build
at bundleWorker
// ...
This is true, I have some local .svg files which I am loading with svgr/webpack into the application. This should hover not bother trigger.dev, since I don't use the components that load these svgs inside the trigger tasks. This worked before, so I think that due to some indirect dependency, some of the utils I am importing in the tasks may import the components/ui/Icon/Icon.tsx file which causes trigger to try to build it.
**My question would be: **
Can I get trigger to ignore these imports? And maybe just return an empty string or something.
My guess would be to use a custom loader with esbuildPlugin or add all icons with additionalFiles.