oneiro
oneiro
SSolidJS
Created by tehquickness on 10/8/2023 in #support
Item in store array being overwritten
Could you provide a bit more detail, please? How are you setting selectedElement?
8 replies
SSolidJS
Created by turtle15 on 10/5/2023 in #support
Anyone using SolidStart in production?
I am currently using it for a project and so far it has been working out fine. Though the docs are still a bit lacking and you have to be aware that breaking changes on newer versions are to be expected. However the community on this discord server is really helpful. So far I've always been able to resolve any issues I encountered relatively quickly.
44 replies
SSolidJS
Created by Julio Barros on 10/2/2023 in #support
Using signal in child component
Could you provide the full code of these components, not just the jsx? That would make it more clear what might be going on 🙂
10 replies
SSolidJS
Created by oneiro on 9/18/2023 in #support
i18n and context issues
A thanks @thetarnav using getters did the trick.
3 replies
SSolidJS
Created by oneiro on 8/17/2023 in #support
What's the best way to debug `Buffer is not defined`
Moving getRouteData into its own file does seem to solve the issue. Though I do not understand, why that is.
3 replies
SSolidJS
Created by oneiro on 8/17/2023 in #support
What's the best way to debug `Buffer is not defined`
For example: I have a file src/pages/myPage/routeData.ts. This looks like this:
import { RouteDataArgs } from "solid-start";
import { createServerData$ } from "solid-start/server";

export function routeData({ params }: RouteDataArgs) {
return createServerData$(getRouteData, { key: () => params.country });
}

export async function getRouteData(countryCode: string) {
// ... do stuff (access database etc.
return {
// ... some data
};
}
import { RouteDataArgs } from "solid-start";
import { createServerData$ } from "solid-start/server";

export function routeData({ params }: RouteDataArgs) {
return createServerData$(getRouteData, { key: () => params.country });
}

export async function getRouteData(countryCode: string) {
// ... do stuff (access database etc.
return {
// ... some data
};
}
The reason for this is, because I want to integration test getRouteData in isolation. Inside my src/routes/myPage.tsx I export route data like this:
// ...imports
export { routeData } from '~/pages/myPage/routeData.ts`
// ...imports
export { routeData } from '~/pages/myPage/routeData.ts`
Now here's the issue: 1. when I do it the way I described, I receive the Buffer is not defined issue 2. when I move routeData into the src/routes/myPage.tsx file it works correctly 3. when I instead move the getRouteData-function into routeData() as arrow function it also works 2. Is not a good option, because when I want to get the typing when using useRouteData inside subcomponents I would create a circular dependency between the route and its sub-components. This is why I want to move routeData out of the route in the first place 3. is not a good option, because I loose the ability to integration test my server side logic without running the solid-start server.
3 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
Yeah, me too 😄 - thanks again for helping out!
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
and it probably worked locally because of OSX's case-insensitive file system 😬
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
ugh - I think there is a typo one of the font-weights 😅
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
oh, no wait - actually we use this font-weight 🤔
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
so for some reason only two of the fonts are inside the directory (probably because of tree-shaking and because the third fontweight isn't being used). However interestingly enough some fonts seem to be imported correctly and one fontweight doesn't. This is probably the issue here: the fontweight is also never used (i guess) which is why it isn't bundled properly, but the import inside the css file remains, which leads to the error. I'll have to check something and make a deployment. I'll report back in a second 🙂 👍 (thanks for helping out btw!)
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
I run solid-start build and afterwards pm2-runtime ecosystem.config.cjs (which uses dist/server.js from the build as entrypoint)
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
so my fonts path is now src/assets/fonts
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
(i put assets in front of it, because I now moved the fonts into an asset dir)
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
html {
font-family: Encode-Sans-Semi-Expanded, sans-serif;
}

@font-face {
font-family: "Encode-Sans-Semi-Expanded";
src: url("./assets/fonts/Encode_Sans_Semi_Expanded/EncodeSansSemiExpanded-Regular.ttf");
font-weight: 400;
}

@font-face {
font-family: "Encode-Sans-Semi-Expanded";
src: url("./assets/fonts/Encode_Sans_Semi_Expanded/EncodeSansSemiExpanded-Semibold.ttf");
font-weight: 600;
}

@font-face {
font-family: "Encode-Sans-Semi-Expanded";
src: url("./assets/fonts/Encode_Sans_Semi_Expanded/EncodeSansSemiExpanded-Bold.ttf");
font-weight: 700;
}
....}
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
html {
font-family: Encode-Sans-Semi-Expanded, sans-serif;
}

@font-face {
font-family: "Encode-Sans-Semi-Expanded";
src: url("./assets/fonts/Encode_Sans_Semi_Expanded/EncodeSansSemiExpanded-Regular.ttf");
font-weight: 400;
}

@font-face {
font-family: "Encode-Sans-Semi-Expanded";
src: url("./assets/fonts/Encode_Sans_Semi_Expanded/EncodeSansSemiExpanded-Semibold.ttf");
font-weight: 600;
}

@font-face {
font-family: "Encode-Sans-Semi-Expanded";
src: url("./assets/fonts/Encode_Sans_Semi_Expanded/EncodeSansSemiExpanded-Bold.ttf");
font-weight: 700;
}
....}
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
I am importing these inside a root.css file which itself is imported inside my root.tsx
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
weird
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
Yeah, I just saw that - however apparently these fonts can then not be resolved correctly, because my browser throws an error
30 replies
SSolidJS
Created by Empress on 8/9/2023 in #support
How to properly import fonts (with Tailwind)
@giyomoon actually I am having a weird issue with the font as well: My fonts dir is located in src/fonts and I import them with url("./fonts/..."). This works well during development, however for some reason in production the browser tries to access the fonts via "<domain>/assets/fonts instead of "<domain>/fonts" > Do you have any idea where the assets part inside the resolved path is coming from?
30 replies
SSolidJS
Created by oneiro on 8/13/2023 in #support
What is the proper way to start solid-start in production (especially with something like pm2)?
yeah, that makes sense 🙂 For my case running pm2 in a single container is easy enough and good enough for now 👍
7 replies