-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
createUniqueId in Toaster causes issues with solid-start #27
Comments
I would have to say |
After debugging this further, the issue seems to be that the Here is what the code looks like: import { Toaster } from "solid-headless"
import { createContext } from "solid-js"
interface MyContextType {
myMethod: () => void
}
const defaultMyContext = {
myMethod: () => {
}
}
const MyContext = createContext<MyContextType>(defaultMyContext);
export function MyToasterProvider(props) {
const myMethod = () => {
// doing things
};
return (<MyContext.Provider
value={{
myMethod
}}
>
{props.children}
<Toaster/>
</MyContext.Provider>)
} |
I don't expect this to produce the issue either. Probably related to the siblings or the parent of |
I'm also seeing this error when trying to render a |
I've experienced this myself so I think I've already found the exact issue as to why this happens. Apparently Astro will mistakenly load SolidJS twice (due to Vite's module resolution) so it will think that solid-headless components were being rendered outside of a SolidJS root. I don't know how to fix this exactly, because I'm convinced that this is either an Astro issue or a Vite issue. |
I've created a relevant issue thread at Astro: withastro/astro#6709 I've still yet to reproduce this issue in SolidStart |
When using the Toaster in solid-start, the following error is given:
After debugging this, I found that the error is thrown from the following line:
https://github.com/lxsmnsyc/solid-headless/blob/3844f9a58dcc2698090eb242635a2715a73741df/packages/solid-headless/src/components/toast/Toaster.ts#L27
The original error is given here:
https://github.com/solidjs/solid/blob/19e63798990be0f40b27a5ddd58fe3af837d818a/packages/solid/src/server/rendering.ts#L68
The text was updated successfully, but these errors were encountered: