Skip to content

[Bug]: Failure when compressing reactflow #10269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
isuro opened this issue May 5, 2025 · 1 comment
Open

[Bug]: Failure when compressing reactflow #10269

isuro opened this issue May 5, 2025 · 1 comment
Assignees
Labels

Comments

@isuro
Copy link

isuro commented May 5, 2025

System Info

System:
OS: Linux 6.13 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
CPU: (8) arm64 unknown
Memory: 8.86 GB / 23.49 GB
Container: Yes
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
Yarn: 4.6.0 - ~/.nvm/versions/node/v20.11.0/bin/yarn
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
Browsers:
Chromium: 123.0.6312.4

Details

node_modules/@reactflow/core/dist/esm/index.js (v11.6.0) looks like this:

...
const errorMessages = {
    '001': () => '[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001',
    '002': () => "It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",
    '003': (nodeType) => `Node type "${nodeType}" not found. Using fallback type "default".`,
    '004': () => 'The React Flow parent container needs a width and a height to render the graph.',
    '005': () => 'Only child nodes can use a parent extent.',
    '006': () => "Can't create edge. An edge needs a source and a target.",
    '007': (id) => `The old edge with id=${id} does not exist.`,
    '009': (type) => `Marker type "${type}" doesn't exist.`,
    '008': (sourceHandle, edge) => `Couldn't create edge for ${!sourceHandle ? 'source' : 'target'} handle id: "${!sourceHandle ? edge.sourceHandle : edge.targetHandle}", edge id: ${edge.id}.`,
    '010': () => 'Handle: No node id found. Make sure to only use a Handle inside a custom Node.',
    '011': (edgeType) => `Edge type "${edgeType}" not found. Using fallback type "default".`,
};

const zustandErrorMessage = errorMessages['001']();
...

However, when rspack compiles it in production mode, errorMessages becomes an empty object {}, and attempts to call the methods inside it fail (TypeError: eI['001'] is not a function).

Reproduce link

No response

Reproduce Steps

  1. Try to import from reactflow@11.6.0
  2. Compiled code fails to run in browser
@isuro isuro added the pending triage The issue/PR is currently untouched. label May 5, 2025
@isuro
Copy link
Author

isuro commented May 5, 2025

This may be swc-project/swc#10435

@LingyuCoder LingyuCoder added upstream and removed pending triage The issue/PR is currently untouched. labels May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants