I'm importing an image from the src/ directory:
import rental601 from '@images/activities/601-rental.webp'
When I try to use rental601 in a function I get an error saying it can't find: 601-rental.webp?origWidth=1920&origHeight=1000&origFormat=webp' which makes sense because I don't have the query parameters in my file name. So I try to chop them off using split:
const unoptimizedBackgroundPath = backgroundPath.split('?')[0]
And it still can't find the image. But that is my image path
11:58:19 [ERROR] [UnhandledRejection] Astro detected an unhandled rejection. Here's the stack trace:
Error: ENOENT: no such file or directory, open '/@fs/home/grahf/Code/blah/src/images/activities/601-rental.webp'
Hint:
Make sure your promises all have an `await` or a `.catch()` handler.
Error reference:
https://docs.astro.build/en/reference/errors/unhandled-rejection/