Skip to content

Vanilla Extract import error with RR7 and Vite 6 #13177

@MattyBalaam

Description

@MattyBalaam

I'm using React Router as a...

framework

Reproduction

https://stackblitz.com/~/github.com/MattyBalaam/vanilla-extract-vite-6-react-router-7

System Info

System:
    OS: macOS 15.3.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 89.27 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.14.0 - /opt/homebrew/opt/node@20/bin/node
    Yarn: 4.2.2 - /opt/homebrew/opt/node@18/bin/yarn
    npm: 9.9.3 - ~/optimus/node_modules/.bin/npm
  Browsers:
    Chrome: 134.0.6998.45
    Safari: 18.3

Used Package Manager

npm

Expected Behavior

In Remix Vanilla Extract works with Vite 6, but there appears to be an incompatibility between RR7 with Vite 6 and Vanilla Extract.

I tried to reproduce the issue just with Vite 6 and Vanilla Extract and could not reproduce.

Actual Behavior

Cannot use import statement outside a module

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions