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

Release web map core as a NPM module #23

Closed
dadiorchen opened this issue Nov 11, 2021 · 4 comments · Fixed by #27
Closed

Release web map core as a NPM module #23

dadiorchen opened this issue Nov 11, 2021 · 4 comments · Fixed by #27
Labels
bug Something isn't working good first issue Good for newcomers high-priority released

Comments

@dadiorchen
Copy link
Collaborator

We can not use/import the leaflet css when we installing the core to other project, like the treetracker-web-map-client next.js will throw error:

image

the reason:
https://nextjs.org/docs/messages/css-npm

Seems because we didn't import the bin/dist of the bundle, we directly import the src file in client, please figure out the correct way to install this package/lib to other clients.


Some hints:

  • Please read our readme for more information/guide/tutorial.
  • Here is an engineering book in Greenstand.
  • To know more about our organization, visit our website.
  • If you want to join the slack community (some resources need the community member's permission), please leave your email address.
@dadiorchen dadiorchen added bug Something isn't working good first issue Good for newcomers labels Nov 11, 2021
@dadiorchen
Copy link
Collaborator Author

import 'leaflet';
import 'leaflet/dist/leaflet.css';
import 'leaflet-utfgrid/L.UTFGrid';
import 'leaflet.gridlayer.googlemutant';

@dadiorchen
Copy link
Collaborator Author

dadiorchen commented Nov 15, 2021

For a temporarily workaround, open the /node_modules/treetracer-web-map-core/src/Map.js and delete the line:

 import 'leaflet/dist/leaflet.css'; 

It might be necessary to delete the .next (if any) under the root folder to avoid caching

Then, paste the line above to the js file where we import the Map.js

@QuaidBartolomei
Copy link
Contributor

I am working on a solution to this

@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers high-priority released
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants