Skip to content

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

@BesitecMH

Description

@BesitecMH

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>
  1. Add code snippet from to MainView: https://vaadin.com/directory/component/leaflet
  2. Run application

Expected behavior
The error should not appear ;-)

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 126.0.6478.128

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions