You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a remix vite project, and when I try to use the Area example in my code, I get an export error:
[vite] Error when evaluating SSR module virtual:remix/server-build: failed to import "/app/routes/unit.$id/route.tsx"
|- /node_modules/@visx/vendor/esm/d3-array.js:8
export * from 'd3-array';
^^^^^^
SyntaxError: Unexpected token 'export'
at internalCompileFunction (node:internal/vm:77:18)
at wrapSafe (node:internal/modules/cjs/loader:1288:20)
at Module._compile (node:internal/modules/cjs/loader:1340:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at cjsLoader (node:internal/modules/esm/translators:356:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:305:7)
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
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?
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:
import { vitePlugin as remix } from "@remix-run/dev";
import { installGlobals } from "@remix-run/node";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
installGlobals();
export default defineConfig({
plugins: [remix(), tsconfigPaths()],
build: {
target: "esnext",
},
});
The text was updated successfully, but these errors were encountered:
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
:The text was updated successfully, but these errors were encountered: