OmegaPirat
External dependencies with npm specifier in combination with vite does not work.
now i run into another issue. I setup fresh and if I want to import
import {BarChart} from "https://deno.land/x/d3nodata@v0.1.3.1/charts.ts"
and use it like
<BarChart datasets={plotData.datasets}/>
It says
TypeError: Cannot read properties of undefined (reading '__H')
at a (https://esm.sh/stable/preact@10.11.0/denonext/hooks.js:2:208)
at j (https://esm.sh/stable/preact@10.11.0/denonext/hooks.js:2:910)
at Object.BarChart (https://deno.land/x/d3nodata@v0.1.3.1/chart-comps/BarChart.tsx:379:3)
18 replies
External dependencies with npm specifier in combination with vite does not work.
It is just a small private project (a differential equation solution plotter to solve and visualize physics problems): It started with node and now I want to transform it to deno.
So you mean I should try a react based framework like fresh?
18 replies
External dependencies with npm specifier in combination with vite does not work.
i just cloned the demo project and tried to start it. It fails with the message
Task dev deno run -A --unstable --node-modules-dir npm:vite
failed to load config from C:\Users\bsiem\WebstormProjects\examples\with-react\vite.config.mjs
error when starting dev server:
TypeError: Invalid package specifier 'npm:react-dom/client@^18.2'. Did you mean to write 'npm:react-dom@^18.2/client'?
18 replies
External dependencies with npm specifier in combination with vite does not work.
Yes I came across of it. Unfortunately they don't make use of the npm prefix outside of the vite config file. For some reason it recognizes the imports if I place the vite dependencies directly into the vite config file instead of the deps.ts. For what are those additional react imports in the vite config good for? Is this important?
https://github.com/denoland/examples/blob/main/with-react/vite.config.mjs
18 replies