using next/image component in storybook throw Error.
yarn create next-app --example with-storybook with-storybook-appnext/imageexport default { title: 'Image' }
// image url
const url = 'https://......'
export const withNextImage = () => (
)
```
show Image without Error as plane image tag do.

The import is fixed when adding @next/plugin-storybook like in PR #18367.
However, this only solves the problem for 3rd party loaders like imgix, cloudinary, etc.
For the default loader, we still need a way to expose the API at /_next/image such that it can be used from a different port.
For example, storybook is running on 6006 and next dev is running on 3000, so we need to change the src to something like http://localhost:3000/_next/image or else the images aren't loaded by the browser when visiting http://localhost:6006.
Is there any workaround for this?
Most helpful comment
The import is fixed when adding
@next/plugin-storybooklike in PR #18367.However, this only solves the problem for 3rd party loaders like imgix, cloudinary, etc.
For the default loader, we still need a way to expose the API at
/_next/imagesuch that it can be used from a different port.For example, storybook is running on 6006 and next dev is running on 3000, so we need to change the
srcto something likehttp://localhost:3000/_next/imageor else the images aren't loaded by the browser when visitinghttp://localhost:6006.