S
SolidJS•12mo ago
vveil

[macOS] Module '"@solidjs/router"' has no exported member 'cache'.

I wanted to follow the example for caching from https://start.solidjs.com/core-concepts/data-loading, but when trying to import the cache function I get the error in the title. I created my project with npm init solid@latest Has anybody any idea what I can do?
SolidStart Beta Documentation
SolidStart Beta Documentation
Early release documentation and resources for SolidStart Beta
7 Replies
vveil
vveilOP•12mo ago
I got this line under dependencies in my package.json: "@solidjs/router": "^0.8.3",
Birk Skyum
Birk Skyum•12mo ago
Strange, it's like you're usign an old version of the create-solid repo. You're supposed to get solidjs/router version 0.10.x when you use the create-solid. Does it say "create-solid version 0.4.0-alpha.0" when you try to initialize? Like this? The published docs are made for this newer version of the router (0.10.x) If you use i.e. the basic template, these are the dependencies to expect:
"dependencies": {
"@solidjs/meta": "^0.29.2",
"@solidjs/router": "^0.10.5",
"@solidjs/start": "^0.4.2",
"solid-js": "^1.8.7",
"vinxi": "0.0.54"
},
"dependencies": {
"@solidjs/meta": "^0.29.2",
"@solidjs/router": "^0.10.5",
"@solidjs/start": "^0.4.2",
"solid-js": "^1.8.7",
"vinxi": "0.0.54"
},
vveil
vveilOP•12mo ago
looks like this when initializing so yes 😄
Birk Skyum
Birk Skyum•12mo ago
what options do you pick in the cli?
vveil
vveilOP•12mo ago
tbh I created the project I was talking about some time ago (a month or so maybe?) Trying it now results in the dependencies you mentioned. Any way to update the dependencies in my existing project?
Birk Skyum
Birk Skyum•12mo ago
You can update what you have, but there are a few things to do. If you look at this example; https://github.com/solidjs/solid-start/tree/main/examples/basic Then you can copy over the "scripts" and "dependencies" section in the package.json, update your vite.config.ts accordingly, update the src/entry-server and src/entry-client, and also rename root.tsx -> app.tsx, and update it accordingly to use the new router.
GitHub
solid-start/examples/basic at main · solidjs/solid-start
SolidStart, the Solid app framework. Contribute to solidjs/solid-start development by creating an account on GitHub.
vveil
vveilOP•12mo ago
Thanks for your help! I'll try to update tomorrow I guess.
Want results from more Discord servers?
Add your server