-
Notifications
You must be signed in to change notification settings - Fork 87
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
Issues with Parcel and Angular #68
Comments
Hey, I had a similiar issue. To see if it was parcel or not, I cloned the repository and switched bundling to webpack. If bundled with webpack, the angular-cli is able to import the 'glify' My knowledge about parcel is limited (non-existent, I didn't even know it exists up to today), so I can't say much about the reasons for it not working in tandem with webpack. I can fork this repository to create a (maintained) webpack version - if the authors of this awesome library approve that! |
I wouldn't mind switching. It'd be nice to know the cause. |
I can stitch together an angular sample that throws the given error. I did some reasearch (not too long, about 2 hours) today to find out about compatbilitiy issues, but I couldn't find any. There are a few things I had to change to get the lib to compile with webpack, though: const glify = new Glify();
export default module.exports = glify; to this: const glify = new Glify();
export default glify; I also had to replace the leaflet imports because tsc was refusing to use the On a totally different side note, I'm planning to write a |
What would it do? |
I'd like to display arbitrary textures on squares, for now. Once I made sufficient progress, I'd like to open a PR for that. |
Hey, so after a deep dive into Webpack and WebGL yesterday and today, I did 2 things:
The webpack version now creates an esnext bundle together with typescript definitions (d.ts files). The development server is working, the only thing I havn't tried yet is the nodeJS version (because I didn't find a sample I could play around with for it). Because of the explorative nature of my hacking yesterday, the webpackification and the texture-markers are a bit mixed up, but I could seperate them again and make a pull request for the webpack version if you are interested. As for the texture markers...I'm not sure if they fit the concept of this library, as I tailored it to my needs:
|
I am trying to get leaflet.glify working in our project. We have a need to speed up our graphics. After a day of having no luck and following the directions on the readme page, I still cannot get it to work. Environment:
Windows 10 Following the direction on readme, I put this in my html file:
and this in my typescript: import * as L from 'leaflet'; ... make points array....
The web page won't even load and gives this error:
Can you please advise how to proceed? I read some of the comments above, but not sure I follow it. Thanks Chris |
Hey @cwgrc2 , Sorry for the late reply, I was on vacation. I might be able to clear up a few things for you now. Apparently, the library doesn't work together with angular 9/10, probably because of some incompatibility with webpack. We forked the library and switched it from parcel to webpack, and it worked. If you want, I can dig into the commit history and create a patch for you. As an alternative, I could also fork this repository and push the commits used to bundle leaflet.glify with webpack. But this isn't really an optional solution. You could try the following:
I would assume that might already fix the error. If thats the case, you can always push the fork to github and create a PR from it. Good Luck! |
@Niklas345, would you like commit access, and possibly be able to clear up the issue here? |
Thanks for replying. Is there any way you could make it work for Angular 9/10? I ask because you and Robert are the experts on this package and it would be best for the community to have it available for everyone. If I try and do what you propose, I might succeed after hours (days?) and I suspect it would be something you could do quickly. I think it makes most sense for you to give it a shot. Again, I point to the documentation on this plugin and it claims it works for Angular, but, in reality, it needs to have this completed for that to be true. Please let me know if you could get this to work, else I will have to try per your instructions and I might have questions. :-) Thanks Niklas. Chris Grant |
Hey all, I had some time to dig into the original issue again, without any success. Parcel hasn't been updated for a while, as they seem to be working on parcel2, hence, updating the dependencies won't be much use. I did some playing around, moving various dependencies from dev into the bundle without success. Parcel is tracking the issue here: parcel-bundler/parcel#2883 @robertleeplummerjr No need for commit access for now. I don't have a solution yet! Given the fact that parcel seems to be a bit unstable for now, would you approve of me making a PR of the webpack version? I might even be able to make it work with both webpack and parcel (two versions, one with -webpack in the name maybe?). |
That'd be great @Niklas345 ! |
All I can say @Niklas345 is that me and my colleague anxiously await anything you can do to help us use leaflet.glify in our application. Thank you, and you too @robertleeplummerjr. Chris |
I opened a PR, but I could need some help with the webpack bundle size. |
@Niklas345 & @robertleeplummerjr Just wondering if you have had any success on this? Would still love to use this in Angular 9/10. Thanks, Chris |
I would really love to have this issue solved as well |
I have tried this approach with no luck. The application (in dev mode using angular and hence webpack) ends up in a cryptic Javascript heap out of mem error. It would be nice to have at least a temporary working approach to be able to use this library inside an angular project
|
Angular 11 (CLI) compiles into production with ngx-leaflet and Leaflet.glify for with no problems except #88 I don't have types rolling into my IDE but am getting by. Might be worth trying again now if you have previously had issues. |
Has anyone being able to import the module in Angular?
I guess the issue comes from using parcel in a webpack environment, but I am just guessing.
It claims:
and doesn't allow the Angular app to start
The text was updated successfully, but these errors were encountered: