deminearchiver
deminearchiver
Explore posts from servers
SSolidJS
Created by deminearchiver on 8/8/2024 in #support
Need help debugging animations
I had a brilliant idea for implementing an animated responsive tab bar component, but I need help debugging animations. Explanation The idea is as follows: instead of making the indicator reside in the tab bar element, move it inside the currently active tab. This way if the tab changes its width the indicator will resize as well. To animate it, we need to calculate offsets (left and right) of the previous tab relative to the current tab. If there are multiple ongoing animations we need to readjust each single one (create a new animation relative to the current tab and set its currentTime to the time of the animation we are adjusting). The problem If I have 2 simulatenous animations, everything works as expected, but with 3 or more the indicator starts shifting. (see attachment) I'm not that good at doing maths in coordinate space, so I must have miscalculated something. I hope someone can point me in the right direction. Minimal, reproducible example To observe the problem, quickly click through 3 or more different tabs (the animation will break) Here's the link to a MRE (heavily simplified): https://codesandbox.io/p/devbox/tab-bar-36kj36
33 replies
SSolidJS
Created by deminearchiver on 7/25/2024 in #support
Cannot build for Vercel
For context So far I'm not satisfied with Solid Start because I wasn't able to deploy the app at least anywhere (I tried Vercel, Netlify and Cloudflare). But Vercel is my main target so this question is about deploying to Vercel specifically. Also I haven't really seen anyone to have the same problem as I do. How to reproduce 1. Create a new Solid Start project
npm init solid@latest
npm init solid@latest
2. Choose any template (I chose hackernews) 3. Edit your app.config.ts as follows:
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
server: {
preset: "vercel-edge",
},
});
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
server: {
preset: "vercel-edge",
},
});
4. Run npm run build Error
ERROR Cannot read properties of undefined (reading 'split')
at /F:/repos/hackernews/node_modules/@rollup/plugin-inject/dist/es/index.js:74:74
at Map.forEach (<anonymous>)
at inject (/F:/repos/hackernews/node_modules/@rollup/plugin-inject/dist/es/index.js:71:16)
at getRollupConfig (/F:/repos/hackernews/node_modules/nitropack/dist/nitro.mjs:2036:29)
at build (/F:/repos/hackernews/node_modules/nitropack/dist/nitro.mjs:2349:24)
at createBuild (/F:/repos/hackernews/node_modules/vinxi/lib/build.js:306:8)
at async Object.run (/F:/repos/hackernews/node_modules/vinxi/bin/cli.mjs:227:5)
at async runCommand (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:316:16)
at async runCommand (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:307:11)
at async runMain (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:445:7)



ERROR Cannot read properties of undefined (reading 'split')
ERROR Cannot read properties of undefined (reading 'split')
at /F:/repos/hackernews/node_modules/@rollup/plugin-inject/dist/es/index.js:74:74
at Map.forEach (<anonymous>)
at inject (/F:/repos/hackernews/node_modules/@rollup/plugin-inject/dist/es/index.js:71:16)
at getRollupConfig (/F:/repos/hackernews/node_modules/nitropack/dist/nitro.mjs:2036:29)
at build (/F:/repos/hackernews/node_modules/nitropack/dist/nitro.mjs:2349:24)
at createBuild (/F:/repos/hackernews/node_modules/vinxi/lib/build.js:306:8)
at async Object.run (/F:/repos/hackernews/node_modules/vinxi/bin/cli.mjs:227:5)
at async runCommand (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:316:16)
at async runCommand (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:307:11)
at async runMain (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:445:7)



ERROR Cannot read properties of undefined (reading 'split')
55 replies
SSolidJS
Created by deminearchiver on 7/10/2024 in #support
Cloudflare Pages deployment route content not loaded
No description
7 replies
SSolidJS
Created by deminearchiver on 7/8/2024 in #support
Per-route CSS when using FileRoutes
If I want to have a CSS file for an individual route (i.e. that route has unique page flow compared to others), where should I put the CSS file? It seems incredibly inconvenient to have CSS files in a separate folder.
// routes/index.tsx
import "./index.css"; // Where should this file be?!

export default function Home() {
return (
<main>
<div class="hero">...</div>
</main>
);
}
// routes/index.tsx
import "./index.css"; // Where should this file be?!

export default function Home() {
return (
<main>
<div class="hero">...</div>
</main>
);
}
11 replies
SSolidJS
Created by deminearchiver on 5/8/2024 in #support
Ref's parentElement
Is it safe to do this? How do I make the parent reactive?
export const Child: Component = (props) => {
let ref!: HTMLElement;

onMount(() => {
ref.parentElement.addEventListener(/*... */);
});

return (
<div ref={ref} />
);
}
export const Child: Component = (props) => {
let ref!: HTMLElement;

onMount(() => {
ref.parentElement.addEventListener(/*... */);
});

return (
<div ref={ref} />
);
}
59 replies
DIAdiscord.js - Imagine an app
Created by deminearchiver on 1/20/2023 in #djs-questions
2+ Clients = API spam?
If I have 2 or more clients on a single IP, will this be considered API spam even though each client has a different token?
import { Client } from "discord.js";

const client1 = new Client(...);
const client2 = new Client(...);

client1.login(process.env["FIRST_TOKEN"]);
client2.login(process.env["SECOND_TOKEN"]);
import { Client } from "discord.js";

const client1 = new Client(...);
const client2 = new Client(...);

client1.login(process.env["FIRST_TOKEN"]);
client2.login(process.env["SECOND_TOKEN"]);
6 replies
DIAdiscord.js - Imagine an app
Created by deminearchiver on 10/30/2022 in #djs-questions
Creating multiple instances of Client
Is it possible for multiple Clients (different tokens) to run concurrently? Considee the following simple example:
const client1 = new Client(...);
const client2 = new Client(...);

client1.login("some token");
client2.login("other token");
const client1 = new Client(...);
const client2 = new Client(...);

client1.login("some token");
client2.login("other token");
6 replies
DIAdiscord.js - Imagine an app
Created by deminearchiver on 8/5/2022 in #djs-questions
Reply to interaction with custom avatar webhook
Is it possible to send an Interaction reply with a custom avatarURL? If it is, how to do it?
5 replies
DIAdiscord.js - Imagine an app
Created by deminearchiver on 7/15/2022 in #djs-questions
Remove Emoji from a Button?
How to remove an emoji from a button using the ButtonBuilder.setEmoji() method? I tried to put null and undefined into the arguments, but neither worked.
9 replies
DIAdiscord.js - Imagine an app
Created by deminearchiver on 7/14/2022 in #djs-questions
Update interaction on Modal Submit
I can't call interaction.update() after I received a ModalSubmitInteraction. After I send a command, the bot replies with a button. After clicking the button, I call ButtonInteraction.showModal(). I want to call ButtonInteraction.update() upon modal submit, but there seems to be no proper way to do it (I am trying to change text on the button received from the modal submit). Are there any workarounds for this?
22 replies