Skip to content

Failed to resolve import "cordova/modulemapper" #230

@w392102398

Description

@w392102398

My project is based on vite 6.2.0.
Today I npm intalled browser-image-compression then I try to use it.
But it occured an error:
[vite] Internal server error: Failed to resolve import "cordova/modulemapper" from "node_modules/.vite/deps/browser-image-compression.js?v=17e0ba09". Does the file exist?
I checked the source code and find this line
s = o && window.cordova && window.cordova.require && window.cordova.require("cordova/modulemapper"),
It seems doesn't compatible with vite.
How could I fixed this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions