D
Deno

help

tsParticles & Deno

Sseraf8/3/2023
Hi, I’m working on a personal project with Deno & Lume. I’m trying to use tsParticles with preact. It seems to be some misconfiguration, but I don’t understand what I’m missing. Here is a PR of my code with a comment with captures : https://github.com/severindupouy/severin-dupouy.deno.dev/pull/1#pullrequestreview-1559886275 I’ve tried to make it work with a fresh install of Fresh, but it’s the same. If you have any lead… Thanks for the help !
Sseraf8/3/2023
@misteroom Hi, I mention you here, if you have any idea about that. Thanks.
SÓscar8/3/2023
Looks like Particles variable is not a function. Maybe it's an issue related to how it's exported (https://github.com/tsparticles/preact/blob/main/components/preact/index.js). Try to import it in a different way like import { Particles } from "..." or something like that.
Sseraf8/3/2023
Nope, doesn’t work neither.
SÓscar8/3/2023
Can you import everything and inspect what do you got? For example
import * as particles from "..."

console.log(particles)
import * as particles from "..."

console.log(particles)
Sseraf8/3/2023
[Module: null prototype] {
default: <ref *1> [Function: h] {
defaultProps: {
width: "100%",
height: "100%",
options: {},
style: {},
id: "tsparticles"
},
Particles: [Circular *1],
default: [Circular *1]
}
}
[Module: null prototype] {
default: <ref *1> [Function: h] {
defaultProps: {
width: "100%",
height: "100%",
options: {},
style: {},
id: "tsparticles"
},
Particles: [Circular *1],
default: [Circular *1]
}
}
SÓscar8/3/2023
This seems to work:
return (
<Particles.default
id="tsparticles"
// init={particlesInit}
// loaded={particlesLoaded}
options={options}
/>
);
return (
<Particles.default
id="tsparticles"
// init={particlesInit}
// loaded={particlesLoaded}
options={options}
/>
);
but you're using hooks and they don't work on server side
Sseraf8/3/2023
mmm… 😛 preact hooks can’t work SSR ?
SÓscar8/3/2023
I don't think so. They are designed to track changes after user interaction or data loading.
Sseraf8/3/2023
ok. I thought that maybe preact-render-to-string could make them usable.

Looking for more? Join the community!

Recommended Posts
Looking for a library to pretty print </br>, <a>, etc tagsAs that title says, I'm looking for a library that can pretty print a string containing the mentioneImporting `puppeteer-cluster` from esm.sh causes `does not provide an export named 'default'` errorWhen importing `https://esm.sh/puppeteer-cluster@0.23.0` I get the following error: ``` error: UncauDeno linting not workingHello everyone, I enabled deno for a subpath in my project (`./supabase`) but unfortunately I'm not deno_pythonI'm trying to use Python with Deno with https://deno.land/x/python@0.2.7 What should I do to enable Deno VS Code plugin too aggressive in auto-completionI'm new to Deno and learning through some tutorials. I'm using VS Code and have the Deno plugin enabhow to exit all async command in deno task?consider this code ```json { "tasks": { "dev-server": "deno run --watch --allow-read --allow-nnode-pre-gyp install failing inside docker containerI'm building something that depends on a library with a native component (pulsar-client) and it doesSet a cookie in GET and retrieve in POSTbeen tryinig to do this for a couple hours now. Basically I want a way to return the user to the prWhat are newUserProps()I'm reading saaskit source, and I don't understand the point of `newUserProps()`. Why not just definRun a detached child process in DenoI'm looking at running a detached child process using Deno. Specifically I want run something like adeno info returns module not found``` deno info https://raw.githubusercontent.com/Murcul/norm/v1.3.0/src/mod.ts error: module could nocan't scrub video```<div className={"flex flex-col text-primary w-full lg:w-1/2 justify-center"}> <video classNamProper usage of `Deno.HttpClient`Hi! I'm creating an application which allows the internal use of HTTP proxies for certain tasks. In What's a good way to write tests for a script which does a bunch filesystem wrangling?As per the title - I have a script which, given a folder, does a bunch of moving and renaming. I'd lHow to access request body in Deno?Thank you.Syntax error when getting prop children Element but compilesIs this error important? How can I fix it? Should I fix it?Generate jUnit XML file from Deno TestsHey is it possible that the Deno Test suite generates a jUnit XML about the Test? So that I can dispHow to do callbacks with `deno_core`?Hello! I've been inspired to write an application after reading this article: https://deno.com/blog/How to ignore ts error when bundling?I run ``` deno bundle '.main.ts' fibery.js ``` and it refuses to work due to 41 errors. Mostly theyStreaming FormDataI have `Deno.serve` a HTML page with `<form enctype="multipart/form-data">` with a `file` input. I