I have integrated @solid/meta in my solid-start project but I keep getting an error.

I have integrated @solid/meta in my solid-start project but I keep getting an error saying <MetaProvider /> should be in the tree. I don't know how to resolve this error even though I configured the MetaProvider at the root level and this is happening in different routes
No description
8 Replies
Madaxen86
Madaxen863d ago
Your app.tsx should be like this:
port default function App() {
return (
<Router
root={props => (
<MetaProvider> <Suspense>{props.children}</Suspense>
</MetaProvider>
)}
>
<FileRoutes />
</Router>
);
}
port default function App() {
return (
<Router
root={props => (
<MetaProvider> <Suspense>{props.children}</Suspense>
</MetaProvider>
)}
>
<FileRoutes />
</Router>
);
}
Ashraf C
Ashraf COP3d ago
I created an external RootLayout file where I defined this and passed it as a prop. However the error is coming when I refresh a page
Ashraf C
Ashraf COP3d ago
Here is the code
No description
Madaxen86
Madaxen863d ago
Put the MetaProvider in your app.tsx?
Ashraf C
Ashraf COP3d ago
still the same issue. It only happens when the page has been loaded
Madaxen86
Madaxen863d ago
Can you share the repo or create a reproduction on stackblitz? https://start.solid.new/
StackBlitz
Solid-start With Tailwindcss Example - StackBlitz
Run official live example code for Solid-start With Tailwindcss, created by Solidjs on StackBlitz
Ashraf C
Ashraf COP10h ago
It will be hard since it's a large project and for a client. I don't know what other options are available.
Madaxen86
Madaxen8610h ago
Probably there is a Meta or Title tag in the server-entry.tsx or somewhere outside the MetaProvider. That’s why the error only occurs on initial page load

Did you find this page helpful?