2

I have been facing issues with the polymer-cli since I installed it. I am not able to serve components during development. I have to write my own Node.js server with remapping urls to work with components. But the documentation page clearly suggests that it had already done this work with its own tool.

What I did

  1. Create a component using polymer-cli's polymer init
  2. Serve the component using polymer serve
  3. The result is unexpected and caused the following errors:

Polymer version: 0.18.0-pre.15

Ubuntu 16.04.2 LTS x64

On running polymer serve

info:    Files in this directory are available under the following URLs
      applications: http://127.0.0.1:8081
      reusable components: http://127.0.0.1:8081/components/test-element/

A) If I try to open localhost:8081

GET http://localhost:8081/webcomponentsjs/webcomponents-loader.js 404 (Not Found)

GET http://localhost:8081/iron-component-page/iron-component-page.html 404 (Not Found)

B) If I try to open `localhost:8081/components/test-element/demo/

The url redirects to http://localhost:8081/home/user-name/project-root/test-element/

The index page in the project root directory is served.

GET http://localhost:8081/home/user-name/project-root/webcomponentsjs/webcomponents-loader.js 

GET http://localhost:8081/home/user-name/project-root/iron-component-page/iron-component-page.html 404 (Not Found)
ryanafrish7
  • 3,222
  • 5
  • 20
  • 35
  • https://polymer.slack.com/archives/C03PF4L4L/p1490962639349938 – ryanafrish7 Mar 31 '17 at 12:33
  • Can you post your bower dependencies? Which version of polymer are you targeting? Your element API: `http://127.0.0.1:8081/components/test-element/` Your element demo: `http://127.0.0.1:8081/components/test-element/demo/index.html` <-- index.html required. Be careful you don't get a file:/// url if editing manually. – Jacob Phillips Apr 05 '17 at 14:53
  • polymer --version gives 0.18.0-pre.15. I'm targeting Polymer 2.0. But I remember facing similar issues with Polymer 1.x. – ryanafrish7 Apr 08 '17 at 08:20
  • It's a project created with polymer init. And, I finished installing all the dependencies it added with bower install. So I am doubtful of where I went wrong. – ryanafrish7 Apr 08 '17 at 08:23
  • It must be in your code somewhere then if the links I posted don't work. – Jacob Phillips Apr 08 '17 at 09:34
  • But the code is created by the polymer-cli itself. So the code cannot be wrong. @JacobPhillips – ryanafrish7 Apr 08 '17 at 16:54

0 Answers0