Skip to content

__vite__mapDeps is not defined #15702

@Bubz43

Description

@Bubz43

Describe the bug

Production builds with dynamic imports will error with __vite__mapDeps is not defined. Looking into the build output, it appears that the __vite__mapDeps function is getting injected into a template literal css string, which is used by @material/web for their component styles, instead of elsewhere to be available to other functions.

Reproduction

https://stackblitz.com/edit/vitejs-vite-igey3u?file=dist%2Fassets%2Findex-WzX_qdTi.js

Steps to reproduce

Run vite build then vite preview

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.14.0 - /usr/local/bin/pnpm
  npmPackages:
    vite: ^5.0.12 => 5.0.12

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)regressionThe issue only appears after a new release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions