S
SolidJS7mo ago
ile

Using SolidStart's prisma template app, getting odd error & crash from the route.

Crash log:
/home/ile/src/polvirekisteri/polvet/node_modules/@solidjs/start/dist/server/StartServer.jsx:65
__vite_ssr_import_6__.useAssets(() => assets.length ? assets.map((m) => __vite_ssr_import_8__.renderAsset(m)) : void 0);
^

TypeError: Cannot read properties of undefined (reading 'length')
at eval (/home/ile/src/polvirekisteri/polvet/node_modules/@solidjs/start/dist/server/StartServer.jsx:65:48)
at Array.<anonymous> (file:///home/ile/src/polvirekisteri/polvet/node_modules/solid-js/web/dist/server.js:539:57)
at injectAssets (file:///home/ile/src/polvirekisteri/polvet/node_modules/solid-js/web/dist/server.js:584:70)
at doShell (file:///home/ile/src/polvirekisteri/polvet/node_modules/solid-js/web/dist/server.js:295:12)
at Object.onDone (file:///home/ile/src/polvirekisteri/polvet/node_modules/solid-js/web/dist/server.js:163:5)
at Te.flush (file:///home/ile/src/polvirekisteri/polvet/node_modules/seroval/dist/esm/production/index.mjs:17:38999)
at file:///home/ile/src/polvirekisteri/polvet/node_modules/solid-js/web/dist/server.js:182:42
/home/ile/src/polvirekisteri/polvet/node_modules/@solidjs/start/dist/server/StartServer.jsx:65
__vite_ssr_import_6__.useAssets(() => assets.length ? assets.map((m) => __vite_ssr_import_8__.renderAsset(m)) : void 0);
^

TypeError: Cannot read properties of undefined (reading 'length')
at eval (/home/ile/src/polvirekisteri/polvet/node_modules/@solidjs/start/dist/server/StartServer.jsx:65:48)
at Array.<anonymous> (file:///home/ile/src/polvirekisteri/polvet/node_modules/solid-js/web/dist/server.js:539:57)
at injectAssets (file:///home/ile/src/polvirekisteri/polvet/node_modules/solid-js/web/dist/server.js:584:70)
at doShell (file:///home/ile/src/polvirekisteri/polvet/node_modules/solid-js/web/dist/server.js:295:12)
at Object.onDone (file:///home/ile/src/polvirekisteri/polvet/node_modules/solid-js/web/dist/server.js:163:5)
at Te.flush (file:///home/ile/src/polvirekisteri/polvet/node_modules/seroval/dist/esm/production/index.mjs:17:38999)
at file:///home/ile/src/polvirekisteri/polvet/node_modules/solid-js/web/dist/server.js:182:42
The crash happens 50% of the time on hard refresh on this route. Sometimes it works, sometimes it crashes. Here's the route file:
import { createAsync, type RouteDefinition } from "@solidjs/router";
import { getUser } from "~/lib/patient/login";
import Header from "~/lib/ui/Header";

export const route = {
load: () => getUser()
} satisfies RouteDefinition;

export default function Home() {
const user = createAsync(() => getUser(), { deferStream: true });
console.log('....', user());

return (
<>
<Header user={user} />
<div class="pt-32 container mx-auto">
<h2 class="font-bold text-3xl">Hello {user()?.username}</h2>
</div>
</>
);
}
import { createAsync, type RouteDefinition } from "@solidjs/router";
import { getUser } from "~/lib/patient/login";
import Header from "~/lib/ui/Header";

export const route = {
load: () => getUser()
} satisfies RouteDefinition;

export default function Home() {
const user = createAsync(() => getUser(), { deferStream: true });
console.log('....', user());

return (
<>
<Header user={user} />
<div class="pt-32 container mx-auto">
<h2 class="font-bold text-3xl">Hello {user()?.username}</h2>
</div>
</>
);
}
Also, I get this console output (server side):
.... undefined
.... {
id: 'ae0f728b-2158-41e0-b170-fd3b863248e5',
username: 'ilkkah@....'
}
.... undefined
.... {
id: 'ae0f728b-2158-41e0-b170-fd3b863248e5',
username: 'ilkkah@....'
}
5 Replies
ile
ileOP7mo ago
It's strange that the console.log() prints this twice and first with undefined. I can see that getUser() works every time, it loads the data from the db correctly. This console.log() is from the server side. On client side the console.log prints only once: sometimes with undefined, sometimes with the correct data. I can create a minimal repo to reproduce. The crash happens on initial load. If the initial page load works, then it works every time after that (a hard refresh). In crashing line there is this:
<script type="module" nonce={nonce} async src={import.meta.env.MANIFEST["client"].inputs[import.meta.env.MANIFEST["client"].handler].output.path}/>
<script type="module" nonce={nonce} async src={import.meta.env.MANIFEST["client"].inputs[import.meta.env.MANIFEST["client"].handler].output.path}/>
I got the same error with the SolidStart tailwincss template app, just out of the box.
shoz
shoz7mo ago
I am hitting the same issue
Siddharth
Siddharth7mo ago
same issue, did you find a solution?
ile
ileOP7mo ago
Probably a bug but I don't know if it's enough to mention it here?
Siddharth
Siddharth7mo ago
I was able to resolve this by clearing node_modules and getting fresh dependencies install
Want results from more Discord servers?
Add your server