tools: Element template has bad paths in demo
After polymer init and polymer serveproject in CLI,
"Uncaught SyntaxError: Unexpected token < " in first line of index.html
Recommended fix:
Add type="javascript" under webcomponents-lite.js script tags for resolving the issue
About this issue
- Original URL
- State: open
- Created 8 years ago
- Comments: 19 (6 by maintainers)
Commits related to this issue
- Fix bug with script tag containing webcomponents-lite.js https://github.com/Polymer/polymer-cli/issues/245 — committed to jlagneau/demo-spa by jlagneau 8 years ago
@almielczarek I just realized that you are talking about the element template. Right now we don’t support the application workflow with reusable elements. That means two things:
polymer serveprints this message:For elements, you need the second URL.
@SayChunKim I still haven’t been able to reproduce this issue with the application template.
on polymer serve i am getting the link below http://127.0.0.1:8080 but i want the url as http://localhost:8080 how can i change it?
I have encountered the same issue but I found a different fix. The version of polymer-cli I am using is 0.11.1 and I am on Windows 7.
The “element” template has some issues with the relative links on the imports. If you initialize the template then serve it and go to the demo page in your browser then check the network tab the developer tools in chrome it will show that instead of the webcomponents-lite.js file it is loading your html template file.
If you change the beginning of the hrefs to read “…/bower_components/” instead of “…/…/” then everything loads correctly. I don’t believe it has anything to do with the type property being “text/javascript” it seems as if the relative path specified does not exist so it is just loading the index.html file of the project root.
Which template are you initializing from? Can you include steps to reproduce from scratch?