SolidJS

S

SolidJS

Solid is a declarative reactive Javascript library for creating user interfaces.

Join

EventSource's response has a MIME type ("text/html") that is not "text/event-stream".

I'm trying to make SSE, but when i load the website I'm getting that error in the console of the website: EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection. I'm just confused how and where to fix that....

With CSR, I see components inside Suspense rendering without waiting for CreateAsync's data

This happens on client side routing.
const routeData: Accessor<ProfileRouteData | undefined> = createAsync(() =>
getData()
);
const routeData: Accessor<ProfileRouteData | undefined> = createAsync(() =>
getData()
);
...

Incorrect response MIME type. Expected 'application/wasm'.

The browser console reports an error: wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'. I am using SolidStart to set up a local-first project. I found electric-sql and am now using its wa-sqlite, which involves wasm. I might need to modify the MIME type, but I am not sure where to configure it....

I have a use case for createResource vs normal async await api call.

``const sendOtp = async({reqId}) => { return await sendApiRequest({ endpoint: "generateotp", data: { reqId,...

Is My Understanding Of RouteSectionProps Correct?

I’ve been trying to implement the cache, load, and createAsync pattern on all of my pages that load data. My goal is to load data on hover before navigating to the page. When the cache function does not need a route parameter, this pattern works as expected....

Page content not updating on route change

I have the following page: ```ts import { createAsync, useParams, type RouteDefinition } from '@solidjs/router'; import { Show, Suspense } from 'solid-js'; import { getInformationById } from '~/api';...

How to get snapshot value from store

Hi, I currently have the following problem. I try to create a file and need values from a Store for this. Here some code: The store state/list-state.js ```...

AggregateError on accessing my db with drizzle-orm and supabase

/src/api/db.ts ```ts import { drizzle } from 'drizzle-orm/postgres-js'; import postgres from 'postgres'; ...

how to create brotli files when building?

vinxi build is only creating gz files

Can't build solid-start app on vercel

I'm getting a build error
[error] [vite:load-fallback] Could not load /vercel/path0/src/app.tsx (imported by node_modules/@solidjs/start/dist/client/StartClient.jsx): ENOENT: no such file or directory, open '/vercel/path0/src/app.tsx'
Error: Could not load src/app.tsx (imported by node_modules/@solidjs/start/dist/client/StartClient.jsx): ENOENT: no such file or directory, open '/vercel/path0/src/app.tsx'
[error] [vite:load-fallback] Could not load /vercel/path0/src/app.tsx (imported by node_modules/@solidjs/start/dist/client/StartClient.jsx): ENOENT: no such file or directory, open '/vercel/path0/src/app.tsx'
Error: Could not load src/app.tsx (imported by node_modules/@solidjs/start/dist/client/StartClient.jsx): ENOENT: no such file or directory, open '/vercel/path0/src/app.tsx'
...

Using session causes "Cannot set headers after they are sent to the client"

Hi! I'm facing a weird behavior when trying to use 'useSession' or 'getSession' in a "use server" function. If I clear the cookies on the page, I get the error "Cannot set headers after they are sent to the client". To reproduce: clone and run https://github.com/livyk/solid-bug (it's a starter with the tailwind template + the sessions example from the docs). Navigate to /users. Clean cookies on the page and you are supposed to get the error. Am I doing something wrong, or it's a potential bug? Thanks!...

Help Me Solve "undefined" warning When Using <Show> Component

I'm using createAsync() to get and order record.
const order = createAsync(() => getOrder(params.chargeId));
const order = createAsync(() => getOrder(params.chargeId));
...

Vercel server call not Allowed: 405 Method Not Allowed

Hi all, I have created a server action which works fine locally: [1st img] -> Successfully prints On Client: Server However, when deploying to vercel, I get the following: [2nd img]...
No description

Vite Certificate

I just ran into problem while creating certificate for localhost, using vite I changed app.config.js the code below is my configuration ` import { defineConfig } from "@solidjs/start/config"; import mkcert from "vite-plugin-mkcert";...

@solidjs/start @solidjs/meta not being SSR'd when resources used, bug or my misuse?

See: https://codesandbox.io/p/devbox/clever-leaf-r4xrg6?file=%2Fsrc%2Froutes%2Fabout.tsx The <title> works fine on the About page, but if you view the HTML document the server provides, it is missing the <title> - it is only added by the client. Everything else renders fine! Cheers!...

Redirect does not happen during load if there is an awaited call before it.

I have this piece of code in Solid Start in my route: ```typescript const getProject = cache(async function ({ id }: { id: string }) { "use server";...

Bug? with ssr, lazy loading, and css.

The image where there is a red line is html after the page is loaded. The other is the html sent by the server. After loading, the page flashes. Access page style is added after the page is loaded, I think it shouldn't be like this. Sorry for my English, I'm not from the USA....
The document sent by the server

how using createRoot?

I am developing a multi-language configuration for my program. I have implemented it in the following way so that it can be called inside the component or in some modules. (If I use context, I can't use it outside the component) However, I get such a warning in the browser console and I'm not sure if such a warning has any positive negative effect. "menus.tsx:10 ...

useNavigate outside of router - for example on authentication faiures?

I have a file of functions for interacting with my backend, I'd like to consolidate some error handling there, for example, if there is an authentication failure, redirect. But as these are not in a router, I can't useNavigate, even though all these functions are called from a component under a router. Is there another strategy I can use here?...