Skip to content

ES modules with primitive default export issue with static import #342

@antfu

Description

@antfu

Environment

Stackblitz

Reproduction

https://stackblitz.com/edit/node-gh8a5m?file=README.md

Screenshot 2024-11-29 at 13 51 13

Describe the bug

In certain cases, when using static import for some packages with Jiti, it returns the whole module instead of the default import. In my test, I encounter that with import isInstalledGlobally from 'is-installed-globally';, as demonstrated in the repro.

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions