-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[polymer-cli] ... does not provide an export named 'default' #608
Comments
@ernsheong I have the same issue with some libraries that do not provide an ESM version of their packages. A simple workaround is to import the non esm version as a classical script in your index.html:
It has the drawbacks to be loaded synchronously at app startup and pollute your globals but at least it makes it possible to use the library with polymer-cli. |
Consider using Webpack which supports different modules formats, if you need the libraries not providing ES module output. |
Hi @web-padwan you have some example of code where you needed use this approach. |
Having tried out React in a project, I am now trying out Polymer, and find that I much prefer the approach. I had the However I am now trying to use OpenLayers (npm ol) and I get I have tried Is there anything else I can try, as OpenLayers is essential to my project, and I would like to use Polymer? I am fairly new to the node environment, and am not experienced with webpack etc. Update |
Hi, anything new on this issue about ES6 module conversion ? I don't know webpack and I'm stuck with several JS packages (invariant, to-camel-case, etc...) used by redux-actions in my polymer project. Could someone point out a webpack configuration to use with Polymer-CLI please ? |
@elvy Polymer CLI does not have any webpack integration at the moment. Check out this repo for a fully configured Polymer app built with webpack: |
@web-padawan Thank you ! But I'm building a polymer 3 element project with a lot of elements in it (no index) and using TypeScript. I don't want to struggle with config for hours as I'm new to webpack but also to Polymer. I think I will just drop redux-actions package for now :/ For those who run into this problem because of redux-actions' non-module dependencies, an issue is opened here. |
@Elvynia then, check out I'm not sure if it supports TS but maybe there should be a way to make it work. |
@web-padawan I'd really appreciate chatting in this channel but I need an invitation link ! |
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. |
There are many npm modules out there that somehow do not work with
polymer serve
The error is usually, e.g.:
What can be done to solve this error (besides getting other modules to publish in ES6 module format)?
The text was updated successfully, but these errors were encountered: