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

NextJs 'next/image' support #73

Open
marcoNonvanilla opened this issue Feb 24, 2022 · 2 comments
Open

NextJs 'next/image' support #73

marcoNonvanilla opened this issue Feb 24, 2022 · 2 comments

Comments

@marcoNonvanilla
Copy link

Viteshot does not fully support NextJs. Things like next image currently don't work.

@ardaerzin
Copy link

our testable components which use next/image are configured this way:

import * as NextImage from 'next/image';
const OriginalNextImage = NextImage.default;

if (process.env.TEST_ENV === 'vreg') {
  Object.defineProperty(NextImage, 'default', {
    configurable: true,
    value: (props) => (
      <OriginalNextImage {...props} unoptimized loader={({ src }) => src} />
    ),
  });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants