Open XiNiHa opened 1 year ago
This is an odd issue. I never reproduced it ever in Chrome, and the only thing that resembled it Firefox it wasn't the same errors you were getting. It was name
or metadata
of undefined which I couldn't find the code for. And even after applying both fixes I could still reproduce it.
Even stranger is that if we assume you made your first fix, there is no way during synchronous code execution the second issue like you pointed at could error. If your condition prevented it from being resolved how could that branch of the ternary ever execute?
For the browser to make a difference on server code seems highly unlikely unless maybe this something related to the development environment. Did you ever try running this in prod mode (I had no luck it was trying to open up an invalid port)?
Right now I can confirm there is something up, but I can't reproduce the issue you were having or its relation to Solid code.
I had the same error message when instantiating a createResource
outside of a component.
const res = createResource(..., { deferStream: true });
const Comp = ()=>{
return <div>{res()}</div>
}
Oh right, I have a similar one in my code, creating a chained resource in a resource until the fetch settles. Maybe runWithOwner
would help here? I'll try that right now...
Oops, turns out that I actually have no code like that 😅 However it feels like I'm somehow reaching the root cause of the issue... I'll keep the further investigation.
I had a similar problem, but it was right after i rebase a branch that modified the pnpm-lock.yaml on anotther branch that contained another modified pnpm-lock.yaml. I solved by deleting the file and running install again
Describe the bug
When server-created
createResource
got read after getting resolved,Uncaught (in promise) TypeError: Cannot use 'in' operator to search for 'data' in undefined
error happens on the server.Your Example Website or App
https://github.com/XiNiHa/solid-relay/tree/feat/ssr-defer
Steps to Reproduce the Bug or Issue
feat/ssr-defer
branchpnpm i
,pnpm build
,cd examples/ssr
,pnpm dev
Additional data...
fallback goes away) Found that this bug only happens occasionally.Expected behavior
I expected the resource to resolve without triggering any errors.
Screenshots or Videos
Expected behavior:
https://github.com/solidjs/solid/assets/8155259/7d14604c-b65e-4cb3-8690-c3de5e67f4e8
Bug happening:
https://github.com/solidjs/solid/assets/8155259/5e40f58a-acaf-41ae-a4ea-472547bffb5a
Platform
Additional context
The exact position where the error is happening is here (verified by monkey-patching the code. adding
sharedConfig.context!.resources[id] &&
check before thein
prevented the error from happening, but then made another error happen at here by accessing.data
inundefined
)Monkey-patching to replace all
sharedConfig.context!.resources[id]
access inread()
toresource
resolved the issue.The bug happens much less frequently in a Private Window.