Skip to content
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.js Image component doesn't work #62

Open
sonngdev opened this issue Apr 21, 2022 · 3 comments
Open

Next.js Image component doesn't work #62

sonngdev opened this issue Apr 21, 2022 · 3 comments
Labels
enhancement Enhancement to current features/ behaviors feature request Request a new feature good first issue Good for newcomers help wanted Extra attention is needed

Comments

@sonngdev
Copy link
Collaborator

Related PR: #60

Jest Preview successfully works with Next.js apps. However, Next's Image component doesn't work. This issue needs further investigation. One of the potential causes is that page's JavaScript is not handled correctly by the plugin.

@nvh95 nvh95 added bug Something isn't working enhancement Enhancement to current features/ behaviors help wanted Extra attention is needed good first issue Good for newcomers feature request Request a new feature and removed bug Something isn't working labels Apr 21, 2022
@nvh95
Copy link
Owner

nvh95 commented Apr 21, 2022

This is actually an expected result. When we run jestPreview.debug(), it captures a snapshot then tries to render that snapshot to an external browser. The Image component from next/image has a lazy loading feature that requires javascript, and the snapshot doesn't have any javascript. So the image couldn't load properly.

This is a very interesting problem. Let's consider it a feature for the next releases.

@tigerabrodi
Copy link

indeed sounds very interesting

@akshg05
Copy link

akshg05 commented Oct 30, 2024

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to current features/ behaviors feature request Request a new feature good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants