vaadin-component-factory / vcf-leaflet

vcf-leaflet provides a Java API for Leaflet.
Other
0 stars 1 forks source link

Using the map causes a "ReferenceError: module is not defined" in browser #16

Open BesitecMH opened 1 month ago

BesitecMH commented 1 month ago

Describe the bug I just added the add-on to my project. Running the application and opening the page in browser causes a Javascript error breaking the startup. (Using Vaadin 23.5.2) The browser's console reports a "ReferenceError: module is not defined" with a link. The link leads to the "Sources" where the "leaflet-canvas-marker/node_modules/rbush/index.js" show the error for code line "module.exports = rbush".

image

I have the problem with my complex project while upgrading from Vaadin 14 to 23. (Previously used the predecessor add-on of this one.) I could not reproduce with a Vaadin 23 skeleton project. But Markus from chat support could in the first step. Later, playing around with the add-on's version, the error vanished also from his example.

To Reproduce Steps to reproduce the behavior:

  1. Download: https://github.com/vaadin/skeleton-starter-flow/archive/v23.zip
  2. Add add-on dependency to pom.xml (version 1.0.1)
  3. Needed also to add the following not to get a Jackson error on startup
    <dependency>
    <groupId>de.grundid.opendatalab</groupId>
    <artifactId>geojson-jackson</artifactId>
    <version>1.13</version>
    </dependency>
  4. Add code snippet from to MainView: https://vaadin.com/directory/component/leaflet
  5. Run application

Expected behavior The error should not appear ;-)

Desktop (please complete the following information):