Circular structure bug when referencing the $el in a different variable
See original GitHub issueReferencing the $el in another object attribute will cause a bug when the devtool stringifies the object.
var component = function() {
return(
{
msg: 'Hello Alpine.js',
init() {
this.div = this.$el
}
}
)
}
See this page here with the console opened: https://cdpn.io/pomartel/debug/abmbyNg/xJAjOeOZonJk The Codepen source here: https://codepen.io/pomartel/pen/abmbyNg
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
What is TypeError: Converting circular structure to JSON?
TypeError : Converting circular structure to JSON occurs when you try to reference your variable name within the JSON object.
Read more >How to fix circular reference in javascript object?
Consequently, we get a runtime error saying we have circular references: Uncaught TypeError: Converting circular structure to JSON ...
Read more >TypeError: cyclic object value - JavaScript - MDN Web Docs
The JavaScript exception "cyclic object value" occurs when object references were found in JSON. JSON.stringify() doesn't try to solve them ...
Read more >Converting circular structure to JSON when using package ...
This is a Bug Report Refs #3344 and #3467 /cc @HyperBrain ... structure to JSON when using package command with self reference #3509....
Read more >Design-time errors in the Windows Forms Designer
Many error types include an exact location in the following format: [Project Name] [Form Name] Line:[Line Number] Column:[Column Number]. If a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Solution here is probably to try to detect Alpine variables that are DOM Nodes and display “DOM Node” or “HTMLElement” instead of the actual value, a bit like we do for “function”
See the following codepen to detect HTMLElement https://codepen.io/hugodf/pen/OJRJwXJ
Here’s what the UI looks like btw, should be good enough for now, I get that having the devtools crash is probably the top priority.