Closed forrestlin2020 closed 2 months ago
It works fine with v18. The problem during npm install is the peerDependency to v17. Could you change the peer dependency to >=17.0.0 instead of caret usage?
@Rambou Thank you for your answer. How to change the peer dependency to >=17.0.0?
Regards
Forrest
@Rambou what do you mean when you say it works fine? It doesn't work for me. It doesn't work with serve
on Vite. When running serve
there's an error:
Failed to resolve dependency: ngx-device-detector, present in 'optimizedDeps.include'
UPD:
Actually, it seems the issue I mentioned is rather related to the fact that I am using NX with npm workspaces and ngx-device-detector
was installed only in one of the apps and since it relied on a different version of angular it was installed into apps/projectname/node_modules
and not into the root one. Probably Angular with Vite cannot get the deps from non-root node_modules
, idk. But I resolved it by moving ngx-device-detector
to the root package.json
. And then I finally ran into the problem with the peerDependencies
. Btw, @forrestlin2020 it can be bypassed using overrides
in your package.json
:
"overrides": {
"ngx-device-detector": {
"@angular/core": "$@angular/core",
"@angular/common": "$@angular/common",
}
}
It works, but would be great to have the package updated too.
@isoroka-plana
Thank you!
I tried making a PR to add Angular 18 support but couldn't get past the problem of the outer package.json
having the library itself as a dependency.
For now, you can add the following to your project's package.json
as the current version does still work with ng18:
"overrides": {
"ngx-device-detector": {
"@angular/common": "$@angular/common",
"@angular/core": "$@angular/core"
}
}
+1
A new release (8.0.0) has been published now 🚀
Thanks @AhsanAyaz ! 😊
@AhsanAyaz
Thanks!
Angular 18 is released. It doesn't work with Angular 18. Can you update it to work with Angular 18?