Closed oferitz closed 1 year ago
Closing cause i found the cause:
there was an import from lib
somewhere and not from es
import 'antd/lib/date-picker/style/index' -> import 'antd/es/date-picker/style/index'
Possible fix to future visitors:
I had a problem with antd
styles as well but the solution above me did not work maybe because antd
was used by a dependency, so I created a PR to fix it in: #3465 and it's fixed in v0.31.2
Describe the bug
I'm trying to migrate a project from CRA+Jest to Vite+Vitest, so far everything went well but now i'm stuck at a point where vitest is failing the majority of the tests with the same error:
Digging into this file reveals that this file is doing require to other file who contains a LESS variable
index.less
So the underlying error is actually:
Now in the app itself everything is working fine, the app transpiles, all less files and variables resolved correctly with this
vite.config.ts
To my understanding Vitest is using the above config so what am i missing here? I tried to set some configuration options like
deps : {fallbackCJS : true}
but it didn't help... Any help will be appreciated.Reproduction
-
System Info
Used Package Manager
npm
Validations