Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

When you start a new element with polymer-cli on the demo page not found in imports #2543

Open luizalexandrew opened 6 years ago

luizalexandrew commented 6 years ago

Description

When starting a new element with polymer-cli imports are not found (404) in demo page, because they are pointing to the wrong folder

Versions & Environment

Steps to Reproduce

  1. Run: polymer init
  2. Choose "polymer-2-element"
  3. Fill in the data needed to create an element
  4. Run with "polymer serve"
  5. Open the console that will show that you did not find the imports

Expected Results

captura de tela de 2017-10-08 11-16-19 //this way it worked

...link rel="import" href="../bower_components/iron-demo-helpers/demo-pages-shared-styles.html"> ...link rel="import" href="../bower_components/iron-demo-helpers/demo-snippet.html"> ...link rel="import" href="../say-myname.html">

Actual Results

captura de tela de 2017-10-08 11-12-51

...link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html"> ...link rel="import" href="../../iron-demo-helpers/demo-snippet.html"> ...link rel="import" href="../say-myname.html">

QuiWorks commented 6 years ago

Polymer elements need to be served from a special directory for development which is {host}/components/{your web component}/demo/

Try starting the server like: polymer serve --open this should open the browser to the correct location.

goerwin commented 6 years ago

@QuiWorks thank you, I was having the same problem. To be honest, that's not very intuitive. I'd expect to just type "localhost:8081" and have the page served without problems

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.