windicss / vite-plugin-windicss

🍃 Windi CSS for Vite ⚡️
MIT License
854 stars 65 forks source link

virtual imports: "The following dependencies are imported but could not be resolved" #301

Closed michealroberts closed 2 years ago

michealroberts commented 2 years ago

Describe the bug

I'm not quite sure what is going on here, but I am seeing the following bug:

The following dependencies are imported but could not be resolved:

virtual:windi.css (imported by /myrepo/apps/app/src/main.ts)

Are they installed?

The error originates from inside main.ts I have the following:

import 'virtual:windi-base.css'
import 'virtual:windi-components.css'
import './assets/index.css'
import 'virtual:windi-utilities.css'

Minimal Reproductions

I am happy to provide access for maintainers that require access to the private repo in question.

Versions

  System:
    OS: macOS 12.3.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 671.38 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Chrome: 104.0.5112.79
    Firefox: 98.0.2
    Firefox Developer Edition: 99.0
    Safari: 15.4
  npmPackages:
    @vitejs/plugin-vue: ^3.0.0 => 3.0.1 
    vite: ^3.0.7 => 3.0.7 
    vitest: 0.21.1 => 0.21.1

Additonal Context

I believe this issue has started occurring since the update for Vite >= v3...

Could someone confirm that this is a "me issue" or a bug please ... ?

michealroberts commented 2 years ago

For me, the index.html was already in the format as explained here: https://github.com/vitejs/vite/issues/3465

So, to confirm, I have already checked for:

<script type="module" src="/src/main.ts"></script>

Perhaps, is this issue happening because I am in a monorepo?

michealroberts commented 2 years ago

D'oh! I must have been tinkering inside the vite.config.ts file and commented out WindiCSS(). 🤦

Marking as resolved.