Cannot add Variable Assigner inside Loop node
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
1.1.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
- Create a Chatflow
- Create a loop node
- Try to add Variable Assigner
✔️ Expected Behavior
A Variable Assigner inside loop node
❌ Actual Behavior
Hey @cufeo! 👋 I'm here to help you with any bugs, questions, or contribution tips while we wait for a human maintainer. Let's squash those bugs together!
The error you're encountering, "Uncaught TypeError: Cannot add property _isShowTips, object is not extensible," suggests that the code is trying to add a new property to an object that has been made non-extensible. This issue occurs in the use-nodes-interactions.ts file, where the code attempts to set iterNodeData._isShowTips = true. The object iterNodeData is derived from parentNode.data and is likely non-extensible due to methods like Object.preventExtensions(), Object.seal(), or Object.freeze() being applied to it [1].
Currently, there are no documented workarounds or solutions specifically for this issue when adding a Variable Assigner inside a Loop node. You might want to check if there are any updates or patches available for your version of Dify that address this problem.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
@dosu how to fix it, what file to modify?
To address the issue of adding a Variable Assigner inside a Loop node, you should focus on the use-nodes-interactions.ts file. The error suggests that the object iterNodeData is non-extensible, which prevents adding new properties like _isShowTips.
Here are some steps you can take to fix this:
-
Check for Non-Extensibility: Look for any code in
use-nodes-interactions.tsthat might be makingiterNodeDatanon-extensible. This could be due to methods likeObject.preventExtensions(),Object.seal(), orObject.freeze(). If you find such code, consider whether it's necessary or if it can be modified to allow extensions. -
Modify Object Creation: If
iterNodeDatais derived fromparentNode.data, ensure that when creating or copying this object, it is not being made non-extensible. You might need to adjust how the object is initialized or copied. -
Test Changes: After making changes, test the workflow to ensure that the Variable Assigner can be added inside a Loop node without errors.
These steps should help you modify the necessary parts of the code to resolve the issue. If you need further assistance with specific code snippets, feel free to ask!
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
I can't add any node after if/else node in iteration node