Skip to content

`import(./${'foo'}/index.js)` fails #15763

@wmertens

Description

@wmertens

Describe the bug

import(`./${'foo'}/index.js`) fails (it complains that it can't decypher the dynamic import) but import(`./`+'foo'+`/index.js`) is fine. This happens when importing from a replaced environment variable.

Reproduction

see above

Steps to reproduce

use a defined-d variable in an import

System Info

System:
    OS: Linux 6.1 NixOS 24.05 (Uakari) 24.05 (Uakari)
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
    Memory: 1.85 GB / 15.20 GB
    Container: Yes
    Shell: 5.2.21 - /run/current-system/sw/bin/bash
  Binaries:
    Node: 20.9.0 - /nix/store/a1hckfqzyys4rfgbdy5kmb5w0zdr55i5-nodejs-20.9.0/bin/node
    npm: 10.1.0 - /nix/store/a1hckfqzyys4rfgbdy5kmb5w0zdr55i5-nodejs-20.9.0/bin/npm
    pnpm: 8.15.1 - /nix/store/3kw9mkkwjd69jaqp5la66g10y7wckq2s-corepack-nodejs-20.9.0/bin/pnpm
  npmPackages:
    vite: ^5.0.12 => 5.0.12

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions