Skip to content
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

VectorLayers are not working #10870

Closed
BHDBvde opened this issue Apr 3, 2020 · 7 comments
Closed

VectorLayers are not working #10870

BHDBvde opened this issue Apr 3, 2020 · 7 comments
Labels

Comments

@BHDBvde
Copy link

BHDBvde commented Apr 3, 2020

Describe the bug
VectorLayers are not working in a Polymer 3 project.
This is not working after this change: #10385
Polymer serve gives an error in the console. TypeError: _rbush.default is not a constructor

I don't think it is good to use transpiled files: (https://www.polymer-project.org/blog/2018-05-02-roadmap-faq#dependencies-not-compatible-with-the-native-module-loader)

To Reproduce

  1. Unzip olinpolymer.zip
  2. Go to the unpacked folder
  3. npm install
  4. npm run polymerserve
  5. See the error in the browser console
    Expected behavior
    Seeing a map.
@ahocevar
Copy link
Member

ahocevar commented Apr 3, 2020

Until all our dependencies come packaged as ES modules (like OpenLayers does already), you'll have to use a bundler. No need to transpile though.

@BHDBvde
Copy link
Author

BHDBvde commented Apr 6, 2020

After reading #8974, I think I understand it. But can you explain why src/structs/RBush.js also uses this import: "import RBush_ from 'rbush/rbush.js';"
I would think you should use the rbush/index.js file because that is the untranspiled file.

@ahocevar
Copy link
Member

ahocevar commented Apr 6, 2020

If we import the untranspiled file, then users have to configure their bundlers to transpile dependencies, which is not common practice.

@BHDBvde
Copy link
Author

BHDBvde commented Apr 6, 2020

Yes but I'm talking about the untranspiled es6 modules in src/ .

@ahocevar
Copy link
Member

ahocevar commented Apr 6, 2020

That might be doable. If you have any idea how (e.g. with a change in build/tsconfig-build.json, which is responsible for the transpilation), you could submit a pull request.

@BHDBvde
Copy link
Author

BHDBvde commented Apr 6, 2020

I don't think that is possible with an change in de tsconfig-build. And for now I do not have another idea.

@stale
Copy link

stale bot commented Jun 5, 2020

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.

@stale stale bot added the stale label Jun 5, 2020
@stale stale bot closed this as completed Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants