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
Since SWC 1.11.9, the following fails: node_modules/@reactflow/core/dist/esm/index.js (v11.6.0) looks like this:
...
consterrorMessages={'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".`,};constzustandErrorMessage=errorMessages['001']();
...
However, when swc minifies it, errorMessages becomes an empty object, and attempts to call the methods inside it fail (TypeError: errorMessages['001'] is not a function).
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Since SWC 1.11.9, the following fails:
node_modules/@reactflow/core/dist/esm/index.js
(v11.6.0) looks like this:However, when swc minifies it,
errorMessages
becomes an empty object, and attempts to call the methods inside it fail (TypeError: errorMessages['001'] is not a function
).Input code
Config
Link to the code that reproduces this issue
https://play.swc.rs/?version=1.11.22&code=H4sIAAAAAAAAA0WOMQuDMBCFd3%2FFwykB0b3i2NUWOopIsKcNaE6S2EXy3xsl0Jvu3ffu7olpN6PXbCCogJY4MqCqkA85LBm1EjxDGfYfsri0WhxHtll67yNF%2B1dZDGhid5YQQqPBEWRnyvbR3vtTJQhsi%2FIT2%2FUGddEikSDP93UWJZUz%2BWfyxeV%2FRJkOpYDaYdXOaTNf05GN44XKhWcxdL70%2FPI2QiF7GQ2hzoIUsv4Bn3aC4PMAAAA%3D&config=H4sIAAAAAAAAA32UwZLbMAiG73mKjM8999AH6PTSZ9AoFnKUSsIjUDaenbx7sWM72Q32zebjBwkQn4fjsblQ2%2Fw6fsqn%2FPS2EJT1Xyw0ZLY3sTTQJkttCT03PxZ6oRF5Gwkm0%2F1BmohIsJDZlkIOfniN3WLqCxC92MRqS1cTZKav%2BpkV%2FBgBl%2FpqPyFGsHmHGEsmZIYOiha4xRhtT2CutihRxpPaEgi1FCOsDM70BXuVZxc4YJac79SBdaZFBwoKBVoOV9BkkktkmeR6yn0m7OBUu27q5zc1XG2slpWccJtaIqdVop4xEBtfs1bCB9yowQPOxf2uDN4U4Fryu%2B6CIW%2F05B%2BAVCBaomwTaHEnDy%2FztKX2u8qQvYwsDwqX%2BdZumaGTopoQvFLZsTJQOGjdLOBqC2NlW%2B04M94oHwUHBryXWVFC00fg9qwl5aEH9AqQ%2FlqvTdUDmPUVbvDxQezg33JL1gds9kiWz9uUhnTCuJMgAZ%2FR7ThIKxi3cZEtceu3ec0OZDTAqS6VJvC%2BBOQBMJoIrM2GPA%2BJaLqIp%2BeamB3u675NNnfP9%2F5l5cKNociK%2BQOxf9lxh9mjSejqJJ1X%2Fdj9aa3Tz%2BbptOzo9VpNoL%2BLcjl0A%2Fm6Bhq1h%2Ft%2F5JlPJEsGAAA%3D
SWC Info output
No response
Expected behavior
SWC should retain the contents of
errorMessages
when minifying, since it is used.Actual behavior
errorMessages
becomes an empty object.Version
>1.11.8
Additional context
No response
The text was updated successfully, but these errors were encountered: