Next.js Image does not render image under Cypress Component test
See original GitHub issueCurrent behavior
I have set up Cypress component testing for Next.js project which make heavy use of next/Image component.
But Next.js dev server launched by Cypress returns 404: Cannot GET /_next/image
Desired behavior
It will be cool to see next.js Image component working.
Test code to reproduce
TO DO
Cypress Version
8.3.1
Other
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:9
Top Results From Across the Web
Test loading of image in Cypress - Stack Overflow
I want to test Cypress that an image is loaded into the page. And my test is like this: it("should display a image...
Read more >Component Testing Next.js Application with Cypress - Medium
In this article, I'll show you how to write Component Testing your Next.js applications with Cypress. This could change your testing ...
Read more >Testing | Next.js
Learn how to set up Next.js with three commonly used testing tools — Cypress, Playwright, Jest, and React Testing Library.
Read more >Testing images with Cypress - YouTube
Today we'll write a test that asserts an image was correctly uploaded and displayed using Cypress.
Read more >Introduction | Cypress Documentation
An overview of Continuous Integration; How to run Cypress tests in ... with an existing node_modules into a cypress/base docker image will not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same issue
Using
next/image
component I’m getting an load resource errorCannot GET /_next/image
A workaround that I found is passing
unoptimized
propThat shows the image in the cypress component environment
This workaround does not like me and I do not recommend it, but it probably gives us a hint of the cause
I am also running into this issue.