[solved] Can't use `@solidjs/router` in external package for SolidStart
I'm trying to write a library for my SolidStart project & need to use the
A
component exported from @solidjs/router
in the library. However, when I use the library in the app it breaks & complains that it needs to be wrapped in <Router>
.
If I copy paste the library code into the SolidStart project it suddenly works flawlessly. Does anyone know what's going on?
For context, I'm trying to create a builder function that returns a wrapped A
component, like so:
Edit: Some additional context
- @solidjs/router
is a peerDependency
in the library, so it should be using the same version6 Replies
Is solidjs itself a dep or peer dep (it needs to be a peer dep)?
Also a peerDependency
These are the packages used in the library
npm list solid-js is a good way to verify you only have a single copy of solid
I don't have any other ideas of what might be wrong
That's it, thank you!
It seems like the library is using router v 0.10 while the app is using 0.13. Not sure why the versions are different, but I'll figure it out
Well, it looks like you specified 0.10.0 as a peer dep, and the
^
only treats minor versions as compatible post 1.0.0
So it considers 0.10 and 0.13 as incompatible libraries, rather than just bumping to the latest version. And as it happens, I think there were some big changes there