Peer Dependency Error: Game / ZimJs

Peer Dependency Error when deploying to AWS Amplify.

"dependencies": {
"@zimjs/game": "^2.8.8",
"easystarjs": "^0.4.4",
"zimjs": "^17.3.3"
}

Note: Worked previously w/

"dependencies": {
"@zimjs/game": "^2.7.1",
"easystarjs": "^0.4.4",
"zimjs": "^17.3.1"
}

2025-03-09T05:24:31.540Z [INFO]: ## Starting Backend Build
                                 ## Checking for associated backend environment...
                                 ## No backend environment association found, continuing...
                                 ## Completed Backend Build
2025-03-09T05:24:31.545Z [INFO]: {"backendDuration": 0}
                                 ## Starting Frontend Build
                                 # Starting phase: preBuild
                                 # Executing command: npm ci --cache .npm --prefer-offline
2025-03-09T05:24:45.938Z [WARNING]: npm ERR!
2025-03-09T05:24:45.950Z [WARNING]: code ERESOLVE
                                    npm ERR! ERESOLVE could not resolve
                                    npm ERR!
                                    npm ERR! While resolving: @zimjs/game@2.8.8
                                    npm ERR! Found: zimjs@17.3.3
                                    npm ERR! node_modules/zimjs
                                    npm ERR!   zimjs@"^17.3.3" from the root project
                                    npm ERR!
                                    npm ERR! Could not resolve dependency:
                                    npm ERR! peer zimjs@"^16.1.9" from @zimjs/game@2.8.8
                                    npm ERR! node_modules/@zimjs/game
                                    npm ERR!   @zimjs/game@"^2.8.8" from the root project
                                    npm ERR!
                                    npm ERR! Conflicting peer dependency: zimjs@16.4.6
                                    npm ERR! node_modules/zimjs
                                    npm ERR!   peer zimjs@"^16.1.9" from @zimjs/game@2.8.8
                                    npm ERR!   node_modules/@zimjs/game
                                    npm ERR!     @zimjs/game@"^2.8.8" from the root project
                                    npm ERR!
                                    npm ERR! Fix the upstream dependency conflict, or retry
                                    npm ERR! this command with --force or --legacy-peer-deps
                                    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
                                    npm ERR!
                                    npm ERR!
                                    npm ERR! For a full report see:
                                    npm ERR! /codebuild/output/src2055754121/src/food-chain-vite/.npm/_logs/2025-03-09T05_24_41_123Z-eresolve-report.txt
                                    npm ERR! A complete log of this run can be found in: /codebuild/output/src2055754121/src/food-chain-vite/.npm/_logs/2025-03-09T05_24_41_123Z-debug-0.log
2025-03-09T05:24:46.046Z [ERROR]: !!! Build failed

Don't know much about Peer Dependencies, beyond what I've educated myself. Wonder if we should use >=version instead of ^version?

I think I remember something about major versions needing to be compatible. Which I found odd. Maybe we should just update all our peer dependencies to 17. But then why did the last game module work. We will update game - and let us know if it builds. Then if so, we will do the other libraries.

Okay - we have updated game to 2.8.91 - we updated to 2.8.9 and realized we just updated the dev dependency rather than the peer dependency. So went to 2.8.91

Whatever you did worked. It is confusing that it worked before. idk.

1 Like

Okay - will go through and update the other libraries peer dependencies in a bit - have set reminder.