Skip to content

Calling import * as a function in development should not work #10039

@adrianhelvik

Description

@adrianhelvik

Describe the bug

We had a bug where import * as moment from 'moment' was called as a function. In development it worked, but in build it did not work.

The correct behavior is that it should not work in development.

Reproduction

https://stackblitz.com/edit/vitejs-vite-amttd2?file=main.js

System Info

Not relevant

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: deps optimizerEsbuild Dependencies OptimizationinconsistencyInconsistency between dev & buildp3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions