-
Notifications
You must be signed in to change notification settings - Fork 418
Open
Labels
bug report π¦Issue is probably a bug, but it needs to be checkedIssue is probably a bug, but it needs to be checkedneeds: complete repro π₯οΈIssue need to have complete repro providedIssue need to have complete repro provided
Description
Environment
@linaria/[email protected]
@wyw-in-js/[email protected]
[email protected]
[email protected]
node.js @ 22.11.0
Description
I have some code which uses d3 to create a force-directed graph. this code appears to work just fine in vite's dev mode, but when building for production I encounter this error:
[wyw-in-js] /Users/<user>/repos/graph-test/frontend/node_modules/d3-force/src/simulation.js: Cannot read properties of null (reading 'name')
file: /Users/<user>/repos/graph-test/frontend/src/pages/Graph/components/GraphVisualization.tsx
error during build:
TypeError: /Users/<user>/repos/graph-test/frontend/node_modules/d3-force/src/simulation.js: Cannot read properties of null (reading 'name')
at getBindingForExport (/Users/<user>/repos/graph-test/frontend/node_modules/@wyw-in-js/transform/lib/plugins/shaker.js:37:59)
at PluginPass.pre (/Users/<user>/repos/graph-test/frontend/node_modules/@wyw-in-js/transform/lib/plugins/shaker.js:234:29)
the line of d3-force/src/simulation.js referenced in the stack trace is this:
export default function(nodes) {
i.e. a default export of type function with no name applied to it.
manually editing d3-force/src/simulation.js and providing a name to that function allows my build to succeed:
export default function foo(nodes) {
fwiw this bug is also present with linaria 5 + @linaria/shaker . I haven't checked older versions.
Metadata
Metadata
Assignees
Labels
bug report π¦Issue is probably a bug, but it needs to be checkedIssue is probably a bug, but it needs to be checkedneeds: complete repro π₯οΈIssue need to have complete repro providedIssue need to have complete repro provided