I modified the demo example to be as minimal as possible but include routing.
If I have the css function in one of the routes, when I switch to a new route I get this error
index.mjs:1 Uncaught (in promise) DOMException: Failed to execute 'querySelector' on 'Element': 'style[s:id="example-Home-32ae95df-0-1"]' is not a valid selector.
at Object.f [as remove] (http://127.0.0.1:5173/node_modules/.vite/deps/solid-styled.js?v=cf718557:37:27)
at Array.<anonymous> (http://127.0.0.1:5173/node_modules/.vite/deps/solid-styled.js?v=cf718557:54:37)
at cleanNode (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-MTPIYOZY.js?v=26f61b75:1028:23)
at cleanNode (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-MTPIYOZY.js?v=26f61b75:1023:7)
at cleanNode (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-MTPIYOZY.js?v=26f61b75:1023:7)
at cleanNode (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-MTPIYOZY.js?v=26f61b75:1023:7)
at cleanNode (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-MTPIYOZY.js?v=26f61b75:1023:7)
at cleanNode (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-MTPIYOZY.js?v=26f61b75:1023:7)
at updateComputation (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-MTPIYOZY.js?v=26f61b75:733:3)
at runTop (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-MTPIYOZY.js?v=26f61b75:844:7)
f @ index.mjs:1
(anonymous) @ index.mjs:1
cleanNode @ dev.js:921
cleanNode @ dev.js:917
cleanNode @ dev.js:917
cleanNode @ dev.js:917
cleanNode @ dev.js:917
cleanNode @ dev.js:917
updateComputation @ dev.js:672
runTop @ dev.js:770
runQueue @ dev.js:840
completeUpdates @ dev.js:796
runUpdates @ dev.js:787
(anonymous) @ dev.js:499
Promise.then (async)
(anonymous) @ routing.js?v=26f61b75:268
untrack @ dev.js:421
navigateFromRoute @ routing.js?v=26f61b75:228
handleAnchorClick @ routing.js?v=26f61b75:338
This has been fixed at #11, but I haven't made a patch release yet. I'll probably include it in the minor release (I'll be pushing some other agenda later on)
I modified the demo example to be as minimal as possible but include routing. If I have the
css
function in one of the routes, when I switch to a new route I get this errorHere's the minimal reproduction I made https://github.com/orenelbaum/solid-styled-routing-bug
The same also holds for the Solid Start template, see https://github.com/solidjs/solid-start/issues/508