Search code examples
polymerpolymer-2.x

Why do I see a deprecation message in the console for a Polymer 2.x app toolbox project?


I've just created a new Polymer 2.x project using Polymer CLI.

In the browser's console I see this message down below. Could you please explain in simple words why do I see this message and how to fix it?

message:

[Deprecation] Styling master document from stylesheets defined in HTML Imports is deprecated, and is planned to be removed in M65, around March 2018. Please refer to [link] for possible migration paths.

screenshot:

enter image description here


Solution

  • If you have created a new Polymer 2.0 project and have not used any style tags in HTML imports outside of a template or custom-style tags anywhere in your code, this warning is actually a false alarm. The Polymer team has fixed the underlying deprecation issue by automatically moving such styles inside the main document. However, this fix requires JavaScript code to be run, which happens after the browser had parsed the HTML and had logged the warning in the console.

    You can read more about the issue here.