ioBI
Denoβ€’3y agoβ€’
14 replies
ioB

solid-js with Deno

I was wondering if it was possible to use solid-js with Deno natively without something like esbuild. This is possible with react (with no config):
import * as React from "https://esm.sh/react@18.2.0"

function MyComponent(props: {name: string}) {
  return <div>Hello {props.name}</div>;
}

console.log(<MyComponent name={"Dev"} />)

Currently my
deno.json
looks likes:
{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "solid-js/h"
  },
  "imports": {
    "solid-js/": "https://esm.sh/solid-js@1.6.11/"
  }
}

and my code looks like
function MyComponent(props: {name: string}) {
  return <div>Hello {props.name}</div>;
}

console.log(<MyComponent name={"Dev"} />)

but when I run it I get
$ deno run -A test.tsx
error: Uncaught SyntaxError: The requested module '/v110/solid-js@1.6.11/deno/web.js' does not provide an export named 'assign'
    at <anonymous> (https://esm.sh/v110/solid-js@1.6.11/deno/h.js:2:20)
Was this page helpful?