Hi everyone, sorry if this question has been answered before but I am not able to get images in storybook, I went through a lot of posts here and modified the preview.js file but still I am not able to get the images when I run storybook and I get this error after modifying the preview.js file - "TypeError: Cannot redefine property: default"
Techstack - NextJS + tailwind
version :
"next": "13.4.13",
"storybook": "^7.2.2"
Here is my preview.js code
import "../src/app/globals.css"
import * as NextImage from "next/image";
const OriginalNextImage = NextImage.default;
Object.defineProperty(NextImage, "default", {
configurable: true,
value: (props) => <OriginalNextImage {...props} unoptimized />,
})
const preview= {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};
export default preview;