mobxjs / mobx-angular

The MobX connector for Angular.
MIT License
483 stars 59 forks source link

please support angular 12 #137

Closed Silentdoer closed 2 years ago

SimonMcKinsey commented 3 years ago

@Silentdoer Is there anything in particular that doesn't work for you?

drowhunter commented 3 years ago

npm ERR! Could not resolve dependency: npm ERR! peer @angular/common@"~11.1.1" from mobx-angular@4.3.0 npm ERR! node_modules/mobx-angular npm ERR! mobx-angular@"*" from the root project

SimonMcKinsey commented 3 years ago

@drowhunter Can you share your package.json file?

pauloantonelli commented 3 years ago

i have the same problem with angular 12 :/

SimonMcKinsey commented 3 years ago

Will upgrade to V13. I'll check that V12 is supported as well.

drowhunter commented 3 years ago

@SimonTouitou

  "name": "hello-world-ang",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~12.2.0",
    "@angular/common": "~12.2.0",
    "@angular/compiler": "~12.2.0",
    "@angular/core": "~12.2.0",
    "@angular/forms": "~12.2.0",
    "@angular/platform-browser": "~12.2.0",
    "@angular/platform-browser-dynamic": "~12.2.0",
    "@angular/router": "~12.2.0",
    "mobx": "6.3.2",
    "mobx-angular": "^4.3.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~12.2.4",
    "@angular/cli": "~12.2.4",
    "@angular/compiler-cli": "~12.2.0",
    "@types/node": "^12.11.1",
    "typescript": "~4.3.5"
  }
}
drowhunter commented 3 years ago

it would appear that mobx 4.3.0 is expecting angular 11 and getting twelve and freaking out

SimonMcKinsey commented 2 years ago

@drowhunter @pauloantonelli @Silentdoer Awaiting CR and extra clarifications for my PR: https://github.com/mobxjs/mobx-angular/pull/145

SimonMcKinsey commented 2 years ago

Merged. Closing.

Menyueru commented 2 years ago

Peer dependencies where left on ~11.1.1 so it is still giving the error

SimonMcKinsey commented 2 years ago

@Menyueru Can you post your package.json? Also, can you paste a snippet of your mobx usage?

Menyueru commented 2 years ago

@SimonTouitou I actually got it working fine with angular 12, but with npm when you try to update angular to any version that's not 11.1.1 you get the following error mentioned by @drowhunter

npm ERR! Could not resolve dependency: npm ERR! peer @angular/common@"~11.1.1" from mobx-angular@4.3.0 npm ERR! node_modules/mobx-angular npm ERR! mobx-angular@"*" from the root project

You can ignore this error with a --force flag and that's what I ended up doing but I do get the occasional warning when running npm telling me about this supposedly broken peer dependency npm WARN mobx-angular@4.3.0 requires a peer of @angular/common@~11.1.1 but none is installed. You must install peer dependencies yourself. npm WARN mobx-angular@4.3.0 requires a peer of @angular/core@~11.1.1 but none is installed. You must install peer dependencies yourself.

I'm guessing this happens because of the following lines in projects/mobx-angular/package.json "peerDependencies": { "@angular/common": "~11.1.1", "@angular/core": "~11.1.1", "mobx": ">=2", "tslib": "^2.0.0" },

Mind you version 4.3 actually works great with angular 12, couldn't get 4.4 to work properly as it was looking for some dependencies in angular that might have been added on angular 13 but I would need to try again since I had also messed up something else on Monday when I tried it.