Repository: unocss/unocss

Issue #3869: error when starting dev server: TypeError: (0 , _presetWind.presetWind) is not a function
Created: 2024-06-05T07:51:49Z
UnoCSS version
0.60.4
Describe the bug
Running the project results in an error：
➜  unocss-vite-test npm run dev

> unocss-vite-test@0.0.0 dev
> vite

error when starting dev server:
TypeError: (0 , _presetWind.presetWind) is not a function
    at /Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/@unocss/preset-uno/dist/index.mjs:69:43
    at /Users/wisdom/Documents/workspace/others/unocss-vite-test/uno.config.ts:10:25
    at evalModule (/Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/jiti/dist/jiti.js:1:247359)
    at jiti (/Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/jiti/dist/jiti.js:1:245172)
    at loadConfigFile (file:///Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/unconfig/dist/index.mjs:177:13)
    at async Object.load (file:///Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/unconfig/dist/index.mjs:98:24)
    at async loadConfig (file:///Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/@unocss/config/dist/index.mjs:43:18)
    at async reloadConfig (file:///Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/@unocss/vite/dist/index.mjs:93:20)
    at async Object.updateRoot (file:///Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/@unocss/vite/dist/index.mjs:125:12)
    at async configResolved (file:///Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/@unocss/vite/dist/index.mjs:1031:7)
    at async Promise.all (index 2)
    at async resolveConfig (file:///Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/vite/dist/node/chunks/dep-BKbDVx1T.js:69639:5)
    at async _createServer (file:///Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/vite/dist/node/chunks/dep-BKbDVx1T.js:65857:20)
    at async CAC.<anonymous> (file:///Users/wisdom/Documents/workspace/others/unocss-vite-test/node_modules/vite/dist/node/cli.js:762:24)


uno.config.ts：
import {
  defineConfig,
  presetAttributify,
  presetUno,
  transformerDirectives
} from 'unocss'

export default defineConfig({
  presets: [
    presetUno(),
    presetAttributify(),
  ],
  transformers: [
    transformerDirectives()
  ],
})
vite.config.ts:
import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import UnoCSS from 'unocss/vite'


// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    UnoCSS(),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})
Reproduction
https://github.com/pdsuwwz/unocss-vite-test
https://stackblitz.com/edit/unocss-unocss-whabz3?file=uno.config.ts,vite.config.ts
System Info
No response
Validations

 Read the Contributing Guidelines.
 Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
 Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
 The provided reproduction is a minimal reproducible example of the bug.

Duplicate issue #3870: TypeError: (0 , _vite.defineConfig) is not a function
Created: 2024-06-05T08:33:31Z
UnoCSS version
1.21.0
Describe the bug
TypeError: (0 , _vite.defineConfig) is not a function
Reproduction

System Info
No response
Validations

 Read the Contributing Guidelines.
 Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
 Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
 The provided reproduction is a minimal reproducible example of the bug.

Closing comment (2024-06-05T09:01:54Z): duplicate: #3869