Closed traviscooper closed 3 months ago
Just got a similar error, but in my case, nested layouts got combined with each other in a nested way:
/.../star-wars/a/+Layout.tsx
/.../star-wars/a/b/+Layout.tsx
/.../star-wars/a/b/@id/+Page.tsx
/.../star-wars/a/b/@id/+datatsx
// /.../a/+Layout.tsx
export { Layout }
const Layout = ({ children }: { children: React.ReactNode }) => {
return (
<div>
<p>AAAAAAA</p>
<div>{children}</div>
</div>
)
}
// /.../a/b/+Layout.tsx
export { Layout }
const Layout = ({ children }: { children: React.ReactNode }) => {
return (
<div>
<p>BBBBBBB</p>
<div>{children}</div>
</div>
)
}
// /.../a/b/3
<div>
<p>AAAAAAA</p>
<div>
<div>
<p>BBBBBBB</p>
<div>
{random star wars movie data}
</div>
</div>
</div>
</div>
"hono": "^4.5.2",
"@universal-middleware/hono": "^0.1.1",
"@hono/node-server": "^1.12.0",
"vike": "0.4.183",
"vike-react": "^0.5.1",
"vite": "5.4.0",
"@vitejs/plugin-react": "^4.3.1",
"tsx": "^4.17.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@traviscooper Have you seen the note at https://vike.dev/Layout saying you need vike-react
? See also https://vike.dev/Layout#without-vike-react-vue-solid.
@Khardian That's expected, see https://vike.dev/Layout#nested-layouts.
I'm moving this to discussions because AFAICT it isn't a Vike issue, but correct me if you believe I'm wrong. Also have a look at https://brillout.github.io/rules#try.
Description
I'm working with the https://github.com/vikejs/vike/tree/main/boilerplates/boilerplate-react-ts example from the repo.
I added a nested
+Layout.tsx
file to the following structure:Issue
Layout is not picked up or handled in any way.
react()
andvike()
plugins are enabled by default in thevite.config.js
file included in the boilerplate.Versions