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

Cannot read properties of undefined (reading 'imageSizes') #1123

Open
deevus opened this issue Jan 24, 2025 · 0 comments
Open

Cannot read properties of undefined (reading 'imageSizes') #1123

deevus opened this issue Jan 24, 2025 · 0 comments

Comments

@deevus
Copy link

deevus commented Jan 24, 2025

Describe the bug
When building a Next.js 15.1.6 project using next-export-optimize-images with remote-image, the build fails with the error:

TypeError: Cannot read properties of undefined (reading 'imageSizes')

To Reproduce

  1. Use RemoteImage in a page
  2. Run next build
  3. See the error

Expected behavior
The build should succeed without the imageSizes error.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: N/A
  • Version: N/A

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A
  • Browser: N/A
  • Version: N/A

Additional context
Issue appears in a static export scenario. Possibly related to how remote-image checks Next.js config for imageSizes.

[TypeError: Cannot read properties of undefined (reading 'imageSizes')]
Error occurred prerendering page "/update-all-hg-repositories-using-powershell". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of undefined (reading 'imageSizes')
    at P:\simonhartcher.com\node_modules\next-export-optimize-images\dist\components\server\remote-image.js:111:42
    at renderWithHooks (P:\simonhartcher.com\node_modules\react-dom\cjs\react-dom-server.edge.production.js:4189:18)
    at renderElement (P:\simonhartcher.com\node_modules\react-dom\cjs\react-dom-server.edge.production.js:4585:18)
    at retryNode (P:\simonhartcher.com\node_modules\react-dom\cjs\react-dom-server.edge.production.js:4871:16)
    at renderNodeDestructive (P:\simonhartcher.com\node_modules\react-dom\cjs\react-dom-server.edge.production.js:4689:7)
    at finishFunctionComponent (P:\simonhartcher.com\node_modules\react-dom\cjs\react-dom-server.edge.production.js:4230:9)
    at renderElement (P:\simonhartcher.com\node_modules\react-dom\cjs\react-dom-server.edge.production.js:4329:7)
    at renderElement (P:\simonhartcher.com\node_modules\react-dom\cjs\react-dom-server.edge.production.js:4604:11)
    at retryNode (P:\simonhartcher.com\node_modules\react-dom\cjs\react-dom-server.edge.production.js:4871:16)
    at renderNodeDestructive (P:\simonhartcher.com\node_modules\react-dom\cjs\react-dom-server.edge.production.js:4689:7)
Export encountered an error on /[pageId]: /update-all-hg-repositories-using-powershell, exiting the build..
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

1 participant