phungleson
phungleson
SSolidJS
Created by phungleson on 11/18/2023 in #support
Attempting to access a stale value from <Show>...
Hi peeps, I have a rather complex application with lots of stores and recently have this issue.
Attempting to access a stale value from <Show> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.
Attempting to access a stale value from <Show> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.
It would be helpful if solid can show me where the issue is? or a way to debug it further. Cheers,
2 replies
SSolidJS
Created by phungleson on 9/11/2023 in #support
Vitest 0.34.4 caused `You appear to have multiple instances of Solid`
Hi peeps, I recently upgraded vitest from 0.34.2 to 0.34.4 and it starts showing for every single test:
stderr | unknown test
You appear to have multiple instances of Solid. This can lead to unexpected behavior.
stderr | unknown test
You appear to have multiple instances of Solid. This can lead to unexpected behavior.
stderr | test name
computations created outside a `createRoot` or `render` will never be disposed
stderr | test name
computations created outside a `createRoot` or `render` will never be disposed
I understand what it means and I am sure I have only 1 version of solid, but I don't know enough to go around to debug this further. I wonder if there is a way get more information to debug this. Vitest 0.34.2 doesn't show that issue. I am using
"vitest": "^0.34.4",
"vite": "^4.4.9",
"solid-js": "^1.7.11"
"@solidjs/testing-library": "^0.8.4",
"vitest": "^0.34.4",
"vite": "^4.4.9",
"solid-js": "^1.7.11"
"@solidjs/testing-library": "^0.8.4",
Thanks,
13 replies
SSolidJS
Created by phungleson on 7/17/2023 in #support
Reactivity does not flow through nested structure and <For />
Hey peeps, I am building a nested structure and it is probably easier to look at the example here https://playground.solidjs.com/anonymous/6b5977b6-6709-413a-93b6-d9cae938b4e7 I expects the result to be 015 but get 012 instead Not sure if anyone might know why updated order doesn't not reflect correctly inside <For /> Thanks,
6 replies
SSolidJS
Created by phungleson on 6/8/2023 in #support
Reactive in case of dynamic data
Hey peeps, I have an object where it can be any random json. Something like this, https://playground.solidjs.com/anonymous/8670f306-cea1-40d4-9a84-3dbc2caa305f It looks like Solid will lose the object reactivity when changing from array to object, vice versa. I wonder if there is a way to overcome this?
5 replies
SSolidJS
Created by phungleson on 4/4/2023 in #support
Handle union type in store
Hi peeps, I would like to store union type like this type Post = NewPost | DeletedPost; in a store. https://playground.solidjs.com/anonymous/7210c31b-5730-4e51-b875-3d8e2f36af4c It seems to work but I wonder if there is a way to tell solid more about the types and avoid type check errors? Thanks!
4 replies
SSolidJS
Created by phungleson on 4/1/2023 in #support
Stricter JSX?
Hey peeps, I recently upgraded to 1.7.0 and seems like there is new stricter JSX. I read the CHANGELOG and understand the issue a bit, i.e. removing function form from JSX.Element. How ever my code (especially in test) use function form quite a bit, like this.
<Provider>
{() => {
actions = userContext();
actions.doesSomethingForTesting();

return <TestingComponent />
}}
</Provider>
<Provider>
{() => {
actions = userContext();
actions.doesSomethingForTesting();

return <TestingComponent />
}}
</Provider>
What should I do make it works without changing too much code? Thanks!
6 replies
SSolidJS
Created by phungleson on 2/16/2023 in #support
onfocus or onFocus or onFocusIn?
It is probably not solid issue, but not sure which one to use. I upgraded latest solid-js and onFocus seems to be gone, not sure if it was even there before? I tried to use onFocusIn but it seem to work with playwright but not vitest i.e. fireEvent.focus? I tried to use onfocus and it works well but it seems like generic html even handler, which is a bit out of place in middle of JSX. I wonder how everyone handle this case?
25 replies
SSolidJS
Created by phungleson on 1/27/2023 in #support
How to make Signal/Resource do incremental update
Hey peeps, My app is a bit evolving and it ended up something like this: https://playground.solidjs.com/anonymous/149dc5aa-a5f4-482e-85ad-727f9f0c2086 I would like to press button and both resource and message updated. I used to use store instead of resource and it works fine. But I would like to move to resources to make use of its functionalities. With current resource code, the whole resource get replaced and message is gone. I wonder whether there is a way to make this work? Cheers,
4 replies
SSolidJS
Created by phungleson on 12/14/2022 in #support
Vite v4 and You appear to have multiple instances of Solid
Hey peeps, I am trying to upgrade my app to vite v4, however it ran into the error in header. The error is clear and I understand what it means. However, I couldn't pin point which part of the app/libs caused the issue. Strangely enough, it was running fine in Vite v2 and v3. It would be great if someone has any thoughts how to debug this? I am using latest of a few libs: "solid-jest": "^0.2.0", "solid-js": "^1.6.5", "vite-plugin-solid": "^2.4.0" "babel-preset-solid": "^1.6.2", "solid-app-router": "^0.4.2", Cheers!
6 replies