Polymer / tools

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

shared-bundle.html 404s #2128

Open robdodson opened 8 years ago

robdodson commented 8 years ago

Running polymer build --entrypoint index.html against the PSK2 branch (https://github.com/PolymerElements/polymer-starter-kit/tree/psk2) generates a file with an import for shared-bundle.html but it doesn't actually create a shared-bundle.html file so I get a 404.

leninmehedy commented 8 years ago

encountered the same issue

carlosrodfern commented 8 years ago

I found same issue: 1)

$ polymer init application
$ polymer build
$ polymer serve build/bundled

2) Open the browser (e.g. Chrome) on http://localhost:8080/

3) Open the Developer Tools and see the GET http://localhost:8080/shared-bundle.html 404 (Not Found) And the generated index.html has this:

<!DOCTYPE html>
<html>
    <head>
        <link rel="import" href="shared-bundle.html">
        <title>app-test</title>
...
vuamitom commented 8 years ago

I'm facing the same issue. Any one have a workaround yet?

ghost commented 8 years ago

Same problem here

stramel commented 8 years ago

Not saying this is a fix but by running, polymer build --fragment bower_components/polymer/polymer.html I was able to get past this issue.

robdodson commented 8 years ago

yeah i don' think i've seen this issue after creating a proper polymer.json that lists a shell and fragments. ex: https://github.com/Polymer/app-drawer-template/blob/master/polymer.json

stramel commented 8 years ago

Seems like the polymer.json would be the correct route to go. Would it make sense to include a base one in the polymer-cli init?

robdodson commented 8 years ago

probably if the templates don't already. But it should also not cause an error if one is missing. I don't think it's required but @FredKSchott would know better :)

ghost commented 8 years ago

When i build i get this even after adding polymer.html to my polymer.json

{
  "entrypoint": "index.html",
  "shell": "src/forms-app/forms-app.html",
  "fragments": [
    "bower_components/polymer/polymer.html"
  ]
}
$ sudo polymer build
info:    Building application...
info:    Generating build/unbundled...
info:    Generating build/bundled...
warn:    Unable to uglify file /Users/Dale/Desktop/Development/test/forms-app/forms-app_test.html_script_0.js
warn:    Unable to uglify file /Users/Dale/Desktop/Development/src/form/behaviors/element-model-generator.html_script_0.js
warn:    Unable to uglify file /Users/Dale/Desktop/Development/bower_components/marked-element/demo/index.html_script_0.js
warn:    Unable to uglify file /Users/Dale/Desktop/Development/bower_components/marked-element/test/marked-element.html_script_0.js
warn:    Unable to uglify file /Users/Dale/Desktop/Development/bower_components/marked-element/test/marked-element.html_script_1.js
warn:    Unable to uglify file /Users/Dale/Desktop/Development/bower_components/marked-element/test/marked-element.html_script_2.js
warn:    Unable to uglify file /Users/Dale/Desktop/Development/bower_components/marked-element/test/marked-element.html_script_3.js
warn:    Unable to uglify file /Users/Dale/Desktop/Development/bower_components/marked-element/test/marked-element.html_script_4.js
warn:    Unable to uglify file /Users/Dale/Desktop/Development/bower_components/web-component-tester/data/index.html_script_0.js
warn:    Unable to uglify file /Users/Dale/Desktop/Development/bower_components/web-component-tester/data/index.html_script_2.js
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
error:   Promise rejection: Error: no resolver found for ../bower_components/polymer/polymer.html
error:   Error: no resolver found for ../bower_components/polymer/polymer.html
    at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:401:25)
    at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:227:50)
    at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)
robdodson commented 8 years ago

@dsnowdon you wouldn't add polymer.html as a fragment. Fragments represent pages in your app. Take a look at https://github.com/Polymer/app-drawer-template for an example

stramel commented 8 years ago

@robdodson I was only able to get past issues with the build when i included polymer as well. It was trying to instantiate Polymer multiple times. I tried doing the following:

{
  "entrypoint": "index.html",
  "fragments": [
    "src/app/pages/page1.html",
    "src/app/pages/page2.html",
    "src/app/pages/page3.html"
  ]
}

The result was Polymer trying to be instantiated multiple times. Adding the bower_components/polymer/polymer.html to the fragments fixed those errors for me.

@dsnowdon Can you post your polymer-cli, node, and OS versions?

FredKSchott commented 8 years ago

So I can confirm that when a proper polymer.json exists, build/bundled is built correctly without any missing shared-bundle.html or 404 errors. When polymer CLI doesn't know the app-shell via the shell flag/property it attempts to build a more generic shared-bundle.html for the application, which is where this bug seems to exist. I'm still digging into why it isn't being created properly.

This explains why:

So for now, the work around is to include the polymer.json file / --shell flag on build.

robdodson commented 8 years ago

Thanks for looking into it @FredKSchott 🔍

pik commented 8 years ago

What exactly is a 'proper' polymer.json, where can I get some more details?

edit: @FredKSchott you mention the shell flag/property but the Polymer-Build README doesn't have anything to say about it. What is it's role and what should it point to?

FredKSchott commented 8 years ago

@pik check out https://developers.google.com/web/updates/2015/11/app-shell for more info on the app-shell pattern.

and more info on proper polymer.json: https://www.polymer-project.org/1.0/docs/tools/polymer-cli#build

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.