S
SolidJS2y ago
seb

Including solidjs router creates multiple instances of solid

I'm trying to add @solidjs/router to a project. But as soon as I import it and add the minimal setup, I get the following warning in my browser console:
You appear to have multiple instances of Solid. This can lead to unexpected behavior.
You appear to have multiple instances of Solid. This can lead to unexpected behavior.
Removing @solidjs/router resolves the issue. My imports look like this:
import { Component } from 'solid-js';
import { render } from 'solid-js/web';
import { A, Routes, Route, Router } from '@solidjs/router';
import { Component } from 'solid-js';
import { render } from 'solid-js/web';
import { A, Routes, Route, Router } from '@solidjs/router';
I had a hunch it was a peer-dependency issue, since @solidjs/router specifies [email protected] while I had [email protected] installed, but downgrading to 1.5.3 didn't end up fixing this issue. Also relevant to note that I'm using vite with vite-plugin-solid and pnpm. Any idea what I could be doing wrong here?
4 Replies
ryansolid
ryansolid2y ago
Which package manager are you using. The router should have a ^ which means it should match against 1.6 versions with clean install, no locks etc.. I haven't seen this be a problem. I wonder.. are you using Vite 4. If so, upgrade to the latest. It was causing this too recently.
seb
sebOP2y ago
I was using [email protected] and [email protected]. I've upgraded to [email protected], and that seems to have fixed the issue. Thank you!
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
ryansolid
ryansolid2y ago
Yeah Vite 4.0.1 had a bug where it caused module duplication breaking a whole bunch of stuff.
Want results from more Discord servers?
Add your server