please help i'm facing this error in livewire Cannot find parent element in DOM tree containing attribute - laravel-livewire

enter image description here
Uncaught (in promise)
Livewire Error:
Cannot find parent element in DOM tree containing attribute: [wire:id].
Usually this is caused by Livewire's DOM-differ not being able to properly track changes.
Reference the following guide for common causes: https://laravel-livewire.com/docs/troubleshooting
Referenced element:
The state.customer first name field is required.

Related

Evaluation of condition failed. Rule item ID: Unknown, condition item ID: Unknown - Operation not valid due to the current state of the object

I'm reviewing the Sitecore logs in my site and I'm getting a huge number of the following error:
ERROR Evaluation of condition failed. Rule item ID: Unknown, condition item ID: Unknown
Exception: System.InvalidOperationException
Message: Operation is not valid due to the current state of the object.
Source: Sitecore.ExperienceAnalytics
at Sitecore.ExperienceAnalytics.Aggregation.Rules.AggregationAdaptor.HistoricalVisitContextBase.GetPages()
at Sitecore.Analytics.Rules.Conditions.HasVisitedPageCondition1.Execute(T ruleContext)
at Sitecore.Rules.Conditions.WhenCondition1.Evaluate(T ruleContext.......
In the past week, this error has occurred >10,500 times
I don't know what to do to figure out what is causing the error or to resolve it. I don't know if it's affecting site performance or not, but I'd like to resolve this issue so I don't have >10k errors happening each week.
This helped me solve the issue: https://sitecoreart.martinrayenglish.com/2017/10/sitecore-xdb-mechanics-guide-to.html
The most common cause of the error is due to old tests that are still part of the content item's configuration, that are either not stopped correctly, inactive or have been removed.
Fixing the Issue
The fix is to remove the bad/old test references from the item in question's Final Renderings XML field.
-Determine what item is throwing the testing exception.
-Enable raw values and standard fields in the “View” section of the “View” tab.
-Copy the Final Renderings XML value of the item and format it so that it is easy to read. This site does a nice job: https://www.freeformatter.com/xml-formatter.html
-Paste you’re the XML into Visual Studio or another editor.
-Locate the attributes in the XML that have a s:pt and remove the attributes.
-Copy and paste the updated XML back into the item's Final Renderings field.
-Save and publish.
After this, the errors will stop appearing in your logs. You will however need to launch your test again.

Issue using Ember.set on Component property

I have a Component which receives a model attribute in some template:
{{#client-user-pipeline-step model=step tasks=step.tasks routeOnOpenAddTaskModal=(route-action "onOpenAddTaskModal")
routeOnOpenEditTextModal=(route-action "onOpenEditTextModal")}}
{{/client-user-pipeline-step}}
As per my understanding, this will be stored as an Ember.Object instance complete with property observers and stuff inside the component. Now when I try to change some property of the model by simply assigning a value to it I get this error:
You must use Ember.set() to set the `name` property (of [object Object])
Which is exactly what I expect as the property is being observed due to data binding. Now when I try to change the value using Ember.set like in this.getModel().set('name', name) ; I get this error:
this.getModel(...).set is not a function
Wow great! I couldn't find a precise explanation of how this data binding thing is supposed to work in the docs, so I'd appreciate if someone could enlighten me on the whole idea and this issue in particular. Thanks!
UPDATE:
The getModel() function is a shorthand for this.get('model').

Ember 1.13 each loop in each loop

As stated here, Ember 1.13 needs a key for the {{each}} helper. Since Ember 1.13.2 the default key is #identity.
Now I am trying to fix my code, I have an each loop nested inside another (piece of code that shows an calendar). I get the following error:
Uncaught Error: Duplicate key found ('(null)') for '{{each}}' helper, please use a unique key or switch to '{{#each model key="#index"}}{{/each}}'.
But even if I add a #guid as key, the error is still shown. Code:
{{#each weeks key="#guid" as |week|}}
<tr>
{{#each week key="#guid" as |day|}}
<td class="day"></td>
{{/each}}
</tr>
{{/each}}
I don't understand that. As #guid should create an unique identifier for each object, why do I still get this duplicate key found error?
EDIT:
My assumption that Duplicate key found had anything to do with nested each loops was plainly wrong. After trying to build a fiddle as Kitler proposed, I did understand my problem (see the answer).
This is a regression in v1.13.x and expected to be resolved in a patch, perhaps v1.13.6
This is the closed issue : https://github.com/emberjs/ember.js/issues/11549
And the merged pull request: https://github.com/emberjs/ember.js/pull/11861
After trial and error, I did understand what was causing the error.
Cause
Some items in my loop where null. Ember 1.13.x and up tries to add an id for every item. As null means nothing, the first null-item get key null, as Ember provides a nothing-key to nothing. The following null-items also get a nothing-key as Ember does that for every null-item.
Error
Because the helper requires a unique id for every item, Ember throws an Duplicate key found ('(null)') error; telling the programmer some items has the same id.
Solution
Fixing this is quite easy, just provide an empty object ({}) instead of null. As one empty object is not the same as another empty object, Ember will create an unique id for every empty object!
Code example: Bin.

TypeError: 'undefined' is not an object (evaluating 'store.createRecord')

I have a 'new' action within a component (Ember.Component) that has the following code in it:
var store = this.get('store');
store.createRecord('child');
yet I'm getting the following error:
TypeError: 'undefined' is not an object (evaluating 'store.createRecord')
The only way I've been able to proceed with this is to find the parent object (always set in the component) by using:
store = this.get('parent.store');
and then proceeding with the createRecord call from above. Is this the "normal" way to proceed?
The store doesn't exist inside of a component, so either you need to pass it into the component, or you have to get it from some parent controller (or passed in controller).
Via Ember Data Transition document (https://github.com/emberjs/data/blob/master/TRANSITION.md)
In general, looking up models directly in a component is an anti-pattern, and you should prefer to pass in any model you need in the template that included the component.
The bad part about it, is you are adding a dependency to ember data in your component, which is supposed to be agnostic of the outside world.

Emberjs form, submit function and action helper errors

http://jsfiddle.net/ACzaJ/7/
This fiddle has the following problems:
When you click: 'clear completed button' you will get the error:
Uncaught Error: assertion failed: Target <Ember.View:ember116> does not have action clearCompletedTodos
And this line generates that error:
<button {{action clearCompletedTodos target="Todos.todosController" }} >
Clear Completed Todos
</button>
I am experimenting with two different submit functions, comment one out per time to try the other:
2a. When i click 'add' button, when using the first submit function by commenting out the second one, no new todo is added and no error is theown. That is nothing happends.
2b. When i comment out the first submit function and use the second submit function, clicking add, throws the error below:
Uncaught TypeError: Cannot call method 'createTodo' of null.
How can i make this todo app, run and add and clear todos. Thanks
UPDATE
Question 1 is now resolved by #pauldechov. But question 2a and 2b is unresolved. The jsfiddle link has been updated too. Thanks #pauldechov.
UPDATE 2
The solution provided by Peter here later had issues and Peter resolved the new issues here:
Previously working emberjs1.0-pre form on jsfiddle returns "error": "Please use POST request"
First off, it looks like you've given your TodoView an id with spaces in it. This id needs to be a valid HTML id so that will definitely cause some problems. Secondly, the submit function is looking for a value on your instance of TodoFormView. However, the value is defined on your TodoView instance. You need to set up a binding between the two.
I've simplified things a bit by getting rid of TodoView for now and just using a standard TextField. Also, your remaining function needed to be changed to do get('length') with quotes instead of get(length). Additionaly, the checkbox API has changed from some of the older examples, see http://docs.emberjs.com/#doc=Ember.Checkbox.
Here's the updated fiddle: http://jsfiddle.net/wagenet/ACzaJ/8/