After updating the next package to v.11.1.0 and running next build I get the following error:
Type error: Cannot find module '../public/images/socialImage.png' or its corresponding type declarations.
10 \| // Custom
11 \| import "../styles/global.css";
12 \| import socialImage from "../public/images/socialImage.png";
It seemed like the package was interfering with static image imports in the application, so I added the following in the next.config.js file (following this solution):
, but this didn't resolve my problem. Instead, since I realized that Next introduced Image Optimization in v.10, I removed the next-optimized-images package and the import in the next.config.js file. Now it works.
After updating the next package to v.11.1.0 and running
next build
I get the following error:It seemed like the package was interfering with static image imports in the application, so I added the following in the next.config.js file (following this solution):
, but this didn't resolve my problem. Instead, since I realized that Next introduced Image Optimization in v.10, I removed the
next-optimized-images
package and the import in the next.config.js file. Now it works.