Invalid next.config.js options detected: - The value at .images.domains[1] must be a string

default discord avatar
Taun
last week
8

Hi. I've just cloned the

https://github.com/payloadcms/template-ecommerce-nextjs

repo and run yarn and when I run yarn dev I'm receiving this error:



PS F:\git\Melex\Melex_FE_3> yarn dev
yarn run v1.22.19
$ next dev
warn  - Port 3000 is in use, trying 3001 instead.
ready - started server on 0.0.0.0:3001, url: http://localhost:3001
info  - Loaded env from F:\git\Melex\Melex_FE_3\.env
warn  - Invalid next.config.js options detected: 
  - The value at .images.domains[1] must be a string but it was undefined.

See more info here: https://nextjs.org/docs/messages/invalid-next-config
Error: Specified images.domains should be an Array of strings received invalid values ().
See more info here: https://nextjs.org/docs/messages/invalid-images-config
    at assignDefaults (F:\git\Melex\Melex_FE_3\node_modules\next\dist\server\config.js:389:23)
    at Object.loadConfig [as default] (F:\git\Melex\Melex_FE_3\node_modules\next\dist\server\config.js:106:32)
    at async NextServer.prepare (F:\git\Melex\Melex_FE_3\node_modules\next\dist\server\next.js:130:24)
    at async F:\git\Melex\Melex_FE_3\node_modules\next\dist\cli\next-dev.js:338:17
error Command failed with exit code 1.


Any ideas to solve?



 warning " > payload-admin-bar@1.0.5" has incorrect peer dependency "react@^17.0.0".
warning " > payload-admin-bar@1.0.5" has incorrect peer dependency "react-dom@^17.0.0".
  • default discord avatar
    thisisnotchris
    last week

    Hey @Taun Looks like you're running another process on the same port so it cant init



    warn - Port 3000 is in use, trying 3001 instead.


    the peer dependency warning can probably be ignore, or even better yet, update the deps and make a PR 🙂

  • default discord avatar
    Taun
    last week

    Thanks Chris

  • default discord avatar
    thisisnotchris
    last week

    No prob, I would try force stopping the process on that port



    (google 'force stop process on port on <operating system>)



    and once it is cleared out ,try to start it again

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.