Open johhorn opened 5 months ago
You could use the "ssr.noExternal" property inside vite.config.ts instead of "serverDependenciesToBundle". For example:
import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
plugins: [
remix({
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
},
}),
tsconfigPaths(),
],
ssr: {
noExternal: ["@visx/vendor"],
},
});
I have a remix vite project, and when I try to use the Area example in my code, I get an export error:
It seems to stem from the
import { max, extent, bisector } from "@visx/vendor/d3-array";
import, as I have tested a different setup with my own data and no tooltip, and if I use the bisector function anywhere, the error occurs, but is not there if I do not use it. Do you have any d3 exports in this package that is not compatible with a remix vite setup?The relevant dependencies I use in this case are:
I noticed that with the old remix server, it was possible to set serverDependenciesToBundle in the config file, and that might have worked with "@visx/vendor/d3-array", but I have not found a similar option for the vite server.
This is my
vite.config.js
: