Don't know why solid context complains it is not called in the right place

https://github.com/kuskusapp/kuskus code of app the thing I don't understand is that we have this store https://github.com/kuskusapp/kuskus/blob/main/src/GlobalContext/userDetails.ts it wraps the whole app here: https://github.com/kuskusapp/kuskus/blob/main/src/pages/App.tsx#L69 including for example <Settings component https://github.com/kuskusapp/kuskus/blob/main/src/pages/App.tsx#L94 however when I run the app and try to render Settings, I get this error
GitHub
GitHub - kuskusapp/kuskus: Fast fully keyboard driven todo app with...
Fast fully keyboard driven todo app with GitHub integration and AI features - GitHub - kuskusapp/kuskus: Fast fully keyboard driven todo app with GitHub integration and AI features
GitHub
kuskus/userDetails.ts at main · kuskusapp/kuskus
Fast fully keyboard driven todo app with GitHub integration and AI features - kuskus/userDetails.ts at main · kuskusapp/kuskus
GitHub
kuskus/App.tsx at main · kuskusapp/kuskus
Fast fully keyboard driven todo app with GitHub integration and AI features - kuskus/App.tsx at main · kuskusapp/kuskus
9 Replies
nikivi
nikiviOP2y ago
it makes no sense to me as Settings.tsx is wrapped in the context of UserDetailsProvider unless the way the context is used is wrong
nikivi
nikiviOP2y ago
GitHub
kuskus/userDetails.ts at main · kuskusapp/kuskus
Fast fully keyboard driven todo app with GitHub integration and AI features - kuskus/userDetails.ts at main · kuskusapp/kuskus
nikivi
nikiviOP2y ago
is error that throws, so there is no ctx
nikivi
nikiviOP2y ago
GitHub
kuskus/todo-list.ts at main · kuskusapp/kuskus
Fast fully keyboard driven todo app with GitHub integration and AI features - kuskus/todo-list.ts at main · kuskusapp/kuskus
nikivi
nikiviOP2y ago
code wise it should be same unless I missed something thank you for any help ❤️
foolswisdom
foolswisdom2y ago
Change all your extensions (from ts) to tsx This is a dev mode issue with our vite plugin, which is difficult enough to fix that it seems to be regarded as a wontfix Every tsx file gets a duplicate version of every ts file it imports Which is fine if the ts files are stateless, but since your context is stateful, getting a duplicate means context will always be empty It should enough to just change the extension for the file the context is defined in
nikivi
nikiviOP2y ago
was silly issue thanks though @foolswisdom
foolswisdom
foolswisdom2y ago
Alright, great 👍 I've definitely had the extension issue before, though it's possible that it was only am issue with library code
Want results from more Discord servers?
Add your server