webcomponents / webcomponents/polyfills

"Cannot set property once" error when used with zone.js

Open
#531 9 comments 5 reactions 0 assignees View on GitHub
Focus Area: Standards & Polyfills Type: Bug
Dominant language
HTML
Stars
1.2k
Forks
168
PR merge metrics
No merged PRs in 30d

Description

### Description

When used with zone.js (all Angular applications), following error is thrown:

```
zone.js:1953 Uncaught TypeError: Cannot set property once of [object Object] which has only a getter
at HTMLDivElement.addEventListener (zone.js:1953:42)
at webcomponents-bundle.js:98:596
at webcomponents-bundle.js:98:767
at webcomponents-bundle.js:382:176
```

### Steps to reproduce

Generate an Angular app and include this polyfill. Start the app.

I've verified that adding a `once` setter removes the error.

#### Expected behavior

Should not throw error

#### Actual behavior

Above error is thrown

### Version

This was introduced in version 2.7 by this PR https://github.com/webcomponents/polyfills/pull/469

### Browsers affected

Only tested on Chrome

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.