Polymer / pwa-starter-kit

Starter templates for building full-featured Progressive Web Apps from web components.
https://pwa-starter-kit.polymer-project.org
2.36k stars 431 forks source link

Build error: '../../my-app.js' does not provide an export named 'html' #264

Closed kr05 closed 5 years ago

kr05 commented 5 years ago

I am working on a project based of the starter kit. I've had no problems until yesterday, when my build started failing. Locally, the project works fine. But after running the build:prpl-server command and serving it using serve:prpl-server, none of the views in the main-content section load. What the contents of this main-section have in common is that they are all dynamically imported. I checked my sources folder and I can confirm that the file was loaded successfully. The line that seems to be causing problems is the following:

image

This line is the same in all of the dynamically imported views. It is what is generated by the build process. The console shows the following error when I load the page:

image

The function at the very top (_loadPage) is the same function provided by the starter kit, but expanded to suit the rest of my views:

image

What seems very odd is that all of the components that are imported statically load just fine, such as a custom footer, app-header, app-toolbar, and some other components. It's only the dynamically imported components that aren't loading. I've tried:

but nothing has worked. Any idea what the problem might be? Thanks for the help.

kr05 commented 5 years ago

Closing this, as I found the real reason my build was breaking: multiple dynamic imports of the same component. These errors have a very sneaky way of creeping up on you. Moral of the story: don't dynamically import a file twice.

keanulee commented 5 years ago

Duplicate #190. This is fixed in master branch of tools but waiting on a release.