question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[3.1.0] Cannot assign to read only property 'form' of object

See original GitHub issue

In the latest 3.1 beta, if I have a button compoment like the below, any attempt to bind to the form attribute triggers this error:

Uncaught TypeError: Cannot assign to read only property 'form' of object '#<HTMLButtonElement>'
    at NewElementBuilder.__setProperty (vendor.js:29024)
    at DefaultDynamicProperty.set (vendor.js:28014)
    at NewElementBuilder.setDynamicAttribute (vendor.js:29035)
    at ComponentElementOperations.flush (vendor.js:27024)
    at Object.evaluate (vendor.js:26541)
    at AppendOpcodes.evaluate (vendor.js:25357)
    at LowLevelVM.evaluateSyscall (vendor.js:28562)
    at LowLevelVM.evaluateInner (vendor.js:28538)
    at LowLevelVM.evaluateOuter (vendor.js:28530)
    at VM.next (vendor.js:30113)
import Component from '@ember/component';

export default Component.extend({
  tagName: 'button',
  attributeBindings: ['form']
});
{{my-button form="my-form"}}

This does not occur in 3.0

I would make a twiddle to reproduce but I can’t seem to remember how to point a twiddle at the beta 🤔

Possibly related to the glimmer-vm upgrade in https://github.com/emberjs/ember.js/pull/15828?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Dhaulagiricommented, Apr 19, 2018

@Exelord you can get the fix for this in 3.1 by pointing your ember-source to https://s3.amazonaws.com/builds.emberjs.com/release/shas/4cb565e3924363b165736cbaff8e4ee5d29218d7.tgz in your package.json 👌

1reaction
rwjbluecommented, Apr 18, 2018

The issue is almost certainly in glimmer-vm itself. I think the next step is to make a failing test PR over there. Based on your demo, I think it would basically be similar to this test

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot assign to read only property of Object in TypeScript
The TypeScript error "Cannot assign to read only property of object" occurs when we try to change a property of a frozen object...
Read more >
angular - Cannot assign to read only property ... - Stack Overflow
After a global update of all my packages, everything started working again. The same for other users, check GitHub issue. My package.json:
Read more >
[Cannot assign to read only property '<field_name>' of object ...
This type of error(Cannot assign to read-only property) generally occurs on update of public property @api decorator variable value.
Read more >
Cannot assign to read only property '0' of string的报错原因之一 ...
2.1 报错原因. auditFailedInfor.certificationStatus数据在转为JSON前是一个object,转换了之后变成了string,所以我在对auditFailedInfor.
Read more >
Defining Read Only Properties in JavaScript - YouTube
By using the Object.defineProperty method you are able to define properties as ' read only ' in JavaScript - this is done by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found