Could not run a simple polymer app

html, polymer

Solution

Due to the nature of polymer you can't just run things with the `file:` URI. See https://www.polymer-project.org/docs/start/reusableelements.html

In the second case try loading your script from `bower_components/webcomponentsjs/webcomponents.js` instead of `bower_components/polymer/polymer.js`.

Problem

OK.. I have configured Polymer Project as it is in This Video Project structure is : My custom element is : ``` <link rel="import" href="../bower_components/polymer/polymer.html"> <polymer-element name="hello-world" noscript> <template> <h1>Hi From Custom Element</h1> </template> </polymer-element> ``` index.html is : ``` <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Title of the document</title> <script type="text/javascript" src="bower_components/polymer/polymer.js"> </script> <link rel="import" href="elements/hello-world.html"> </head> <body> <hello-world></hello-world> </body> </html> ``` OK.. When I run this code without Server I get error : ``` Imported resource from origin 'file://' has been blocked from loading by Cross-Origin Resource Sharing policy: Received an invalid response. Origin 'null' is therefore not allowed access. ``` and when I run the app on WAMP I get error : ``` Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': Nodes of type 'HTML' may not be inserted inside nodes of type '#document'. Uncaught TypeError: object is not a function ``` in polymer.js any help in this case?

Original source