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
next/jest tests error when testing next/future/image even when enabled in config #38383
Comments
I thought i had the same issue, well kind of had but i realized i had some old code in my
just added the variabel to this
And it seems to work, don't remember when i was adding this config but i had a link to #18373 in my code. Maybe you have the same issue @ornous or someone else ending up here. |
I'm also witnessing the same issue. I'm using
|
Yes @olaj! I'd been trying to assign the object directly to __NEXT_IMAGE_OPTS but it wasn't having any impact. Setting to a new object works for me! I imagine the next/jest plugin is meant to set these env vars after reading next.config.js and hence the issue should remain open although there is a work around? |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Which example does this report relate to?
with-jest
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I've enabled next future image feature but any tests that exercise them fail:
The next image component works fine using
yarn dev
and I even receive this warning when I run my tests before the error:Expected Behavior
next/future/image is enabled for my test run if enabled in next config and disabled otherwise
To Reproduce
pages/index.tsx
to next/future/imageexperimental: { images: { allowFutureImage: true } }
pnpm test -- --watchAll
The text was updated successfully, but these errors were encountered: