I tried to convert the Polymer 2 stater-kit example to Polymer 3 and it fails to load in the browser. I'm using
polymer --version: 1.7.7
node --version: v8.11.3
npm --version: 6.3.0
bower --version: 1.8.4
Ubuntu 16.04.1
I followed these instructions to create the Polymer 2 start-kit app: https://www.polymer-project.org/2.0/start/toolbox/set-up
mkdir polymer2-3-upgrade-app
cd polymer2-3-upgrade-app
polymer init
I chose polymer-2-starter-kit
When I ran: polymer serve, it worked fine. I was up and running with Polymer 2 successfully.
Then I followed this guide: https://www.polymer-project.org/3.0/docs/upgrade to convert to Polymer 3:
modulizer --out . --npm-version 1.0.0
(Omitted --import-style name as recommended for application projects.)
[1/2] 馃寑 Converting Package...
Out directory: /home/dsyrstad/IdeaProjects/polymer2-3-upgrade-app
Failed to read entrypoints of package 'shadycss' because the package does not have a 'bower.json' file.
polymer-starter-kit: Did not find an HTML main in bower.json. A main was not added to package.json, so this package will not be directly importable by name. Manually update main in your bower.json or package.json to fix.
[2/2] 馃帀 Conversion Complete!
Then I ran:
npm install
Which told me:
npm WARN deprecated [email protected]: This package is unmaintained. Use @sinonjs/formatio instead
npm WARN [email protected] No repository field.
added 65 packages from 482 contributors and audited 575 packages in 4.091s
found 4 vulnerabilities (3 low, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
It appeared the conversion basically worked, so I ran: polymer serve
I opened http://127.0.0.1:8081 in Chrome.
Chrome Dev console reported:
webcomponents-loader.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
polymer-element.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
app-drawer.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
app-drawer-layout.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
app-header.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
app-header-layout.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
app-scroll-effects.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
app-toolbar.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
app-location.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
app-route.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
iron-pages.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
iron-selector.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
paper-icon-button.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
settings.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
html-tag.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
import-href.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
Only index.html, my-*.js, and service-worker.js were loaded by the browser. None of the node_modules loaded, probably because of imports like this:
import { PolymerElement } from '../../@polymer/polymer/polymer-element.js';
And this line in index.html:
<script src="../@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
Also tried:
polymer serve --npm
polymer serve --npm --module-resolution="node"
polymer serve --npm --module-resolution="none"
polymer serve --module-resolution="none"
All give the same result.
Help? I also cannot get my current Polymer 2 app to convert because of spread operators.
Note: I originally raised this issue in https://github.com/Polymer/polymer-modulizer/issues/461 not knowing that project is defunct. It would be good if someone monitored the issues there. There's another new one after mine...
This issue is more than 1 month old and blocking a lot of people. Can we have a little help regarding how to fix it?
I have exact same errors-
polymer --version: 2.0
node --version: v10.11.0
npm --version: 6.4.1
bower --version: 1.8.4
OS- windows 10
Also I used to get the JAVASCRIPT HEAP OUT OF MEMORY, I used the command SET NODE_OPTIONS "--max-old-space-size=8192". Then this error stoped.
After receiving the errors mentioned above. Polymer generated around 39 files all related to coverage and tests, but no polymer file is converted. I also tried supplying a main in bower.json but it did not help either.
It seems the conversion works without errors on Mac OS but fails on widows and ubuntu.
It seems the conversion works without errors on Mac OS.
This issue was reported against Ubuntu.
Is the modulizer even being maintained anymore? Apparently no response from the team here. I mean, it's a sad state of things if it won't even convert the Polymer 2 sample app.
I agree! We need a bug free tool to upgrade to P3 & lit-element!
Help me, Obi-Wan Kenobi. You're my only hope.
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.
Most helpful comment
I agree! We need a bug free tool to upgrade to P3 & lit-element!