Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

SyntaxError: "_lockedElementCache" is read-only #267

Open
mgibas opened this issue Feb 26, 2018 · 7 comments
Open

SyntaxError: "_lockedElementCache" is read-only #267

mgibas opened this issue Feb 26, 2018 · 7 comments

Comments

@mgibas
Copy link

mgibas commented Feb 26, 2018

Latest version 3.0.0-pre.10 gives me an error during webpack build:

ERROR in ./node_modules/@polymer/iron-overlay-behavior/iron-scroll-manager.js
Module build failed: SyntaxError: "_lockedElementCache" is read-only

  78 |   _lockingElements.push(element);
  79 | 
> 80 |   _lockedElementCache = [];
     |   ^
  81 |   _unlockedElementCache = [];
  82 | }
  83 | 

as well as during a runtime:

Uncaught ReferenceError: _boundScrollHandler is not defined
    at _lockScrollInteractions (iron-scroll-manager.js:163)
    at pushScrollLock (iron-scroll-manager.js:75)
    at HTMLElement.__updateScrollObservers (iron-overlay-behavior.js:624)
@xlzlzhl
Copy link

xlzlzhl commented Feb 26, 2018

it is const

@evancaldwell
Copy link

I am also having this issue. I understand that it is a const but the question is why. The issue linked above by RebeccaStevens implies that the modularizer isn't converting it properly. Would love to see this fixed.

Locally I converted

export const _lockingElements = [];
export const _lockedElementCache = null;
export const _unlockedElementCache = null;

to

export var _lockingElements = [];
export var _lockedElementCache = null;
export var _unlockedElementCache = null;

Which resolved the webpack error but still results in a runtime error: _boundScrollHandler is undefined.

@evancaldwell
Copy link

Also, tracking backward in the code it looks like iron-scroll-manager is trying to use Polymer but it's not imported anywhere that I can see.

@NicolaiSchmid
Copy link

I can confirm the issue for the newest pre-12 version as well

@valdrinkoshi
Copy link
Member

@aomarks FYI - would it help to mark those properties as @private?

@aomarks
Copy link
Contributor

aomarks commented Mar 26, 2018

At a high level, we unfortunately have not been testing any Polymer 3 pre-release code with Closure compilation yet, and have no handling in modulizer to update Closure annotations to match the transformed code, so I would expect all kinds of issues until we do that.

@TitanNano
Copy link

I think this deals with the same issue: https://github.com/Polymer/polymer-modulizer/issues/345

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants