e-mission / e-mission-docs

Repository for docs and issues. If you need help, please file an issue here. Public conversations are better for open source projects than private email.
https://e-mission.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
15 stars 34 forks source link

Issue Running `serve` on latest MacOS version #1053

Closed the-bay-kay closed 9 months ago

the-bay-kay commented 9 months ago

Background

 /Users/{user}/Documents/OpenPATH_Repos/e-mission-phone/node_modules/macos-release/index.js:28
    const [name, version] = nameMap.get(release);
                            ^

 TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
     at macosRelease (/Users/{user}/Documents/OpenPATH_Repos/e-mission-phone/node_modules/macos-release/index.js:28:26)
     at osName (/Users/{user}/Documents/OpenPATH_Repos/e-mission-phone/node_modules/phonegap/node_modules/insight/node_modules/os-name/index.js:21:18)
     at new Insight (/Users/{user}/Documents/OpenPATH_Repos/e-mission-phone/node_modules/phonegap/node_modules/insight/lib/index.js:37:13)
     at Object.<anonymous> (/Users/{user}/Documents/OpenPATH_Repos/e-mission-phone/node_modules/phonegap/node_modules/cordova/src/telemetry.js:26:15)
     at Module._compile (node:internal/modules/cjs/loader:1246:14)
     at Module._extensions..js (node:internal/modules/cjs/loader:1300:10)
     at Module.load (node:internal/modules/cjs/loader:1103:32)
     at Module._load (node:internal/modules/cjs/loader:942:12)
     at Module.require (node:internal/modules/cjs/loader:1127:19)
     at require (node:internal/modules/helpers:112:18)

 Node.js v19.5.0
 phonegap --verbose serve exited with code 1
--> Sending SIGTERM to other processes..
 webpack --config webpack.dev.js --watch exited with code SIGTERM

const nameMap = new Map([ [22, ['Ventura', '13']], [21, ['Monterey', '12']], [20, ['Big Sur', '11']], // ...


## Potential Solutions
Initially, I tried manually adding [23, ['Sonoma', '14']] to this file, with no success.  This, of course, wouldn't't have been a long term solution (since this isn't tracked by our git).  I believe there is different issue with our npm packages.
From what I've read in [this](https://stackoverflow.com/questions/75118115/const-name-version-namemap-getrelease) stack overflow thread, the issue should be fixed then the corresponding node module is updated.  Clicking through onto [this](https://stackoverflow.com/questions/68318289/ionic-fails-building-in-macos-12-monterey) thread, it seems that this module is dependant on `cordova`'s version.  When checking our `package.serve.json`, we have the following cordova-related dependancies...
```json
    "cordova": "^11.1.0"
     "phonegap": "9.0.0+cordova.9.0.0",

Updating cordova to the latest version (12.0.0) does not fix the build error. This seems to suggest that the issue may be with ionic, or another related dependency. When running npm ls macos-release, we receive the following output:

├─┬ @ionic/cli@6.20.8
│ └─┬ os-name@4.0.1
│   └── macos-release@2.5.1
└─┬ phonegap@9.0.0
  ├─┬ insight@0.10.3
  │ └─┬ os-name@3.1.0
  │   └── macos-release@2.5.1 deduped
  └─┬ os-name@2.0.1
    └── macos-release@1.1.0

As can be seen here, this macos-release is a few versions behind the plugin's current 3.2.0 link.

My thought, then, is to begin updating these plugins, starting with the lowest version, until we find one that will (i) not break our codebase going too far forward, and (2) update the macos-release version to an acceptable value.

I'm currently being pulled in a few different directions, and won't be able to address this immediately -- the bluetooth integradtion (link) needs to be wrapped up first. My desktop PC is struggling, but I should be able to continue with Android Development while the macos serve is broken.

That being me to my final thoughts -- if anyone has experience with these version issues, please feel free to add your two cents! Any pointers or advice would be greatly appreciated.

the-bay-kay commented 9 months ago

Finally found the solution! As Jack and Shankari suggested, the issue was with node_modules/macos-release/index.js and setup/autoreload/macos-index.js. The solution was to: