Skip to content

ReferenceError: L is not defined on prod builds with optimizeBundle = true #15

@chippmann

Description

@chippmann

Describe the bug
I try to build a prod build of my application with an optimized frontend bundle. But when i do that i receive the following error in the browser console, no map is drawn and all subsequent calls to leaflet fail: ReferenceError: L is not defined

On dev builds and prod builds with optimizeBundle = false everything works as expected though.

In your sample application i see that you also have optimizeBundle = false but IMO that does not sound like a great idea for a prod application.

But maybe I'm just missing something obvious which applies to addons in general (this is the only third party addon i use)?

I'm using Vaadin 24.4.3 and vcf-leaflet 2.0.1.

To Reproduce
Steps to reproduce the behavior:

  1. build a vaadin application with vcf-leaflet in prod and with optimizeBundle = true
  2. open the application in a browser and open the console

Expected behavior
The application can be built for prod with optimizeBundle = true.

Desktop (please complete the following information):

  • OS: Arch Linux (Endeavour OS)
  • Browser: Firefox, Chromium
  • Version: Vaadin: 24.4.3, vcf-leaflet: 2.0.1

Thx a lot for your work!

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