Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown file extension ".css" error after updating to 0.31.2 #3472

Closed
6 tasks done
vknowles-rv opened this issue May 30, 2023 · 3 comments · Fixed by #3485
Closed
6 tasks done

Unknown file extension ".css" error after updating to 0.31.2 #3472

vknowles-rv opened this issue May 30, 2023 · 3 comments · Fixed by #3485

Comments

@vknowles-rv
Copy link

vknowles-rv commented May 30, 2023

Describe the bug

deps.inline not working in 0.31.2: #3472 (comment)

After updating to 0.31.2 globally mocking CSS supports no longer works

global.CSS = { supports: () => false , escape: (ident) => ident};

This is used to get passed the Unknown file extension ".css" mentioned in the title for libraries like vuetify and element-plus via deps.inline

Reproduction

vitest Config

    config.test = {
        reporters: 'verbose',
        globals: true,
        deps: {
            inline: ["vuetify"],
        },
        setupFiles: ["./test/setup_file.ts"],
        environment: "happy-dom",
        cache: {
            dir: "./.vite-cache",
        },
    };

setup_file.ts contains the typescript mentioned in the description

System Info

System:
    OS: macOS 13.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 83.80 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.20.0 - ~/.nvm/versions/node/v16.20.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.19.4 - ~/.nvm/versions/node/v16.20.0/bin/npm
  Browsers:
    Chrome: 113.0.5672.126
    Firefox: 113.0.1
    Safari: 16.4
  npmPackages:
    @vitejs/plugin-vue: ^4.0.0 => 4.2.3
    vite: ^4.0.0 => 4.3.9
    vitest: 0.31.2 => 0.31.2

Used Package Manager

npm

Validations

@github-actions
Copy link

Hello @vknowles-rv. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@vknowles-rv
Copy link
Author

vknowles-rv commented May 30, 2023

edit

last edit? remove empty suite test
Working on 0.31.1: https://stackblitz.com/edit/vitest-dev-vitest-tbbrya?file=package-lock.json

another edit fix package-lock pointing to 31.1
Failing on 0.31.2: https://stackblitz.com/edit/vitest-dev-vitest-x2figp?file=package.json

@sheremet-va
Copy link
Member

After updating to 0.31.2 globally mocking CSS supports no longer works

global.CSS only mocks accessing CSS variable, it doesn't affect importing/requiring .css.

But it looks like deps.inline stopped working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants