PolymerElements / iron-overlay-behavior

Makes an element an overlay with an optional backdrop
41 stars 71 forks source link

SyntaxError: "_lockedElementCache" is read-only #267

Open mgibas opened 6 years ago

mgibas commented 6 years ago

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 commented 6 years ago

it is const

evancaldwell commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

valdrinkoshi commented 6 years ago

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

aomarks commented 6 years ago

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 commented 6 years ago

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