You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uncaught SyntaxError: The requested module '/node_modules/.pnpm/[email protected]/node_modules/hammerjs/hammer.js?v=cd432710' does not provide an export named 'default' (at index.js:2:8)
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Jinjiang
changed the title
Fail to import default from a commonjs package like hammerjs in node_modules with optimizeDeps.exclude config
Fail to import default from a commonjs package like hammerjs from a file in node_modules with optimizeDeps.exclude config
Jul 19, 2024
Describe the bug
import * as Hammer from "hammerjs";
in source file works,import Hammer from "hammerjs";
in source file works,import * as Hammer from "hammerjs";
in an npm package works,import Hammer from "hammerjs";
in an npm package works,import * as Hammer from "hammerjs";
in an npm package withoptimizeDeps.exclude
config works, however,import Hammer from "hammerjs";
in an npm package withoptimizeDeps.exclude
config doesn't workReproduction
https://github.com/Jinjiang/reproductions/tree/vite-deps-20240719
Steps to reproduce
System Info
Used Package Manager
pnpm
Logs
Validations
The text was updated successfully, but these errors were encountered: