- While coding for Polymer JavaScript library for web component you will face an exception “ReferenceError Platform is not defined”, though all the library are included properly.
- In this Demo, “We will see How it occurs and its solution “.
- Below screen shot shows the chrome inspect of loaded HTML of a sample polymer code.You can mark the platform file is loaded in 2nd script.This causes the above mention Reference error in chrome browser while it will run properly in Firefox.
- Thus the incorrect order of script files causes the Reference error.Below screenshot shows the Chrome console with this error.
- Once the platform.js is moved to the top of the header scripts the Reference error will be solved.Below screenshot shows the modified script libraries and platform JavaScript file moved top of the page to resolve this issue.