-
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
Uncaught (in promise) Error: "layer.canvas" not properly defined #110
Comments
have you been able to find a solution to the problem? |
I get the same error in a browser using the browser build of Leaflet.glify, This is how the map is created:
The error occurs when a layer with GeoJSON is created using this map:
|
+1. normal functionality in dev, throws during testing using vitest |
This error is thrown due to the I have tried mocking the CanvasOverlay class in every way possible As I brainstorm workarounds, one idea is to re-ship this package so that dependent packages could access its "internals" more intuitively, specifically for mocking. Ex. making this possible vi.mock("leaflet.glify", async (importOriginal) => {
const mod = await importOriginal<typeof import("leaflet.glify")>();
return {
...mod,
CanvasOverlay: ... //mock the canvas overlay here
}
}); Another idea, if possible, would be to refactor the CanvasOverlay class to respect testing environments by default, so that dependent packages do not need to worry about this, if that is possible. |
I'm getting this error, please advice
The text was updated successfully, but these errors were encountered: