the magic guy
the magic guy
Explore posts from servers
SSolidJS
Created by the magic guy on 4/25/2024 in #support
Vite error when evaluating SSR module
Getting this error when navigating to a route
2:52:46 p.m. [vite] Error when evaluating SSR module #vinxi/handler/ssr: failed to import "/src/entry-server.tsx"
|- TypeError: __vite_ssr_import_0__.template is not a function
at eval (/home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/@solidjs/start/dist/server/renderAsset.jsx:11:52)
at async instantiateModule (file:///home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:55036:9)

[h3] [unhandled] TypeError: __vite_ssr_import_0__.template is not a function
at eval (/home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/@solidjs/start/dist/server/renderAsset.jsx:11:52)
at async instantiateModule (file:///home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:55036:9) {
cause: TypeError: __vite_ssr_import_0__.template is not a function
at eval (/home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/@solidjs/start/dist/server/renderAsset.jsx:11:52)
at async instantiateModule (file:///home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:55036:9),
statusCode: 500,
fatal: false,
unhandled: true,
statusMessage: undefined,
data: undefined
}
2:52:46 p.m. [vite] Error when evaluating SSR module #vinxi/handler/ssr: failed to import "/src/entry-server.tsx"
|- TypeError: __vite_ssr_import_0__.template is not a function
at eval (/home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/@solidjs/start/dist/server/renderAsset.jsx:11:52)
at async instantiateModule (file:///home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:55036:9)

[h3] [unhandled] TypeError: __vite_ssr_import_0__.template is not a function
at eval (/home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/@solidjs/start/dist/server/renderAsset.jsx:11:52)
at async instantiateModule (file:///home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:55036:9) {
cause: TypeError: __vite_ssr_import_0__.template is not a function
at eval (/home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/@solidjs/start/dist/server/renderAsset.jsx:11:52)
at async instantiateModule (file:///home/shawn/projects/gh_actions_dashboard/solid-project/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:55036:9),
statusCode: 500,
fatal: false,
unhandled: true,
statusMessage: undefined,
data: undefined
}
This started happening when I started using suid material. I have also set SSR to false in app.config.ts:
export default defineConfig({
ssr: false,
solid: {
ssr: false
},
vite: {
plugins: [suidPlugin(), solidPlugin()],
},
});
export default defineConfig({
ssr: false,
solid: {
ssr: false
},
vite: {
plugins: [suidPlugin(), solidPlugin()],
},
});
Feels like im missing smth pretty simple here....
3 replies
SSolidJS
Created by the magic guy on 4/23/2024 in #support
Wrapping `<FileRoutes />` in `ErrorBoundry`
No description
5 replies
SSolidJS
Created by the magic guy on 8/10/2023 in #support
solid start `npm run build` hangs in docker container
51 replies
SSolidJS
Created by the magic guy on 8/7/2023 in #support
createResource / Suspense blocks rendering
Im trying to understand how to handle async data fetching. Taking an example from the docs, with some modifications. This component seem to block rendering for 5 seconds, before displaying Data fetched from API, rather than showing the fallback in the Suspense element while the setTimeout is happening. I feel like im not understanding something here...
import { createResource, Suspense } from "solid-js";

async function fetchData(): Promise<string> {
return new Promise((resolve) => {
setTimeout(() => {
resolve("Data fetched from API");
}, 5000); // Simulate a 2-second delay
});
}
export default function () {
const [resource] = createResource(fetchData);

return (
<Suspense fallback={<p>loading...</p>}>
<div>HELLO WORLD</div>
{resource()}
</Suspense>
);
}
import { createResource, Suspense } from "solid-js";

async function fetchData(): Promise<string> {
return new Promise((resolve) => {
setTimeout(() => {
resolve("Data fetched from API");
}, 5000); // Simulate a 2-second delay
});
}
export default function () {
const [resource] = createResource(fetchData);

return (
<Suspense fallback={<p>loading...</p>}>
<div>HELLO WORLD</div>
{resource()}
</Suspense>
);
}
11 replies