Next.js Image Component Not Rendering PNGs from Local Static Folder When Using Custom Webpack Config
I'm migrating some code and I'm refactoring my project and I'm working on a project and hit a roadblock... I'm having trouble with the Next.js Image component not rendering PNG images that I have stored in the `public/images` folder... My Next.js version is 12.0.5, and I'm using a custom Webpack configuration to handle some additional loaders for my project. The Image component appears to be returning an empty element, and I don't see any behavior in the console. Here's the code snippet I'm using to import and render the image: ```javascript import Image from 'next/image'; const MyComponent = () => { return ( <div> <Image src="/images/myImage.png" alt="My Image" width={500} height={300} /> </div> ); }; export default MyComponent; ``` When I inspect the element, it shows that the `img` tag is present in the DOM, but the `src` attribute is not set correctly. It looks something like `src="data:image/png;base64,..."` instead of the expected path. I tried clearing the cache and re-building the project, but that didn't help. I also checked that the file is indeed in the `public/images` folder by accessing it directly in the browser at `http://localhost:3000/images/myImage.png`, which loads fine. In my `next.config.js`, I have this basic Webpack setup: ```javascript module.exports = { webpack: (config) => { // Custom Webpack configurations return config; }, }; ``` I suspect that my custom Webpack configuration might be interfering with how Next.js loads images, but I'm not sure how to debug this scenario further. Has anyone else faced this question or have suggestions on how to resolve it? For context: I'm using Javascript on macOS. Is there a simpler solution I'm overlooking? Any help would be greatly appreciated! I'm working in a Windows 11 environment. Any ideas how to fix this?