#23485·Vite

vite 8 regression for inlined awaited import as it triggers syntax error after transform

Author: smeng9Created Sep 14, 2026Updated Sep 14, 2026
Labelspending triage

Describe the bug

After vitest 5.0.0 is released we are planning to update all of our vite and vitest dependencies to their latest major. This is the exact same bug (same logic but not duplicated) that is fixed in vitest 5.0.0 https://github.com/vitest-dev/vitest/pull/10784, import(await ...) is a valid syntax in JS.

It seems vite 7 does not have such issue because it doesn't have the __vitePreload. Also this bug seems only happens in production, not development environment.

Reproduction

https://stackblitz.com/edit/okjv1kps

Steps to reproduce

Run the build:v7 and build:v8 script and compare the output.

System Info

System:
    OS: macOS 26.5.2
    CPU: (8) arm64 Apple M2
    Memory: 100.75 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 26.0.0 - /opt/homebrew/bin/node
    Yarn: 4.15.0 - /opt/homebrew/opt/infisical-tools/libexec/wrappers/yarn
    npm: 11.12.1 - /opt/homebrew/bin/npm
    bun: 1.3.14 - /Users/username/.bun/bin/bun
  Browsers:
    Safari: 26.5.2

Used Package Manager

yarn

Logs

SyntaxError: Unexpected identifier 'no'. import call expects one or two arguments. in browser.

Validations