unocss / unocss

The instant on-demand atomic CSS engine.
https://unocss.dev
MIT License
16.64k stars 836 forks source link

【BUG】Cannot find module 'uno.css' ,It seems that the new version will have adaptation issues #4038

Closed Simonmie closed 3 months ago

Simonmie commented 3 months ago

@nuxt/unocss version 0.61.8

Describe the bug

bf8a72a66e60bc140893ffd495847c0 My project is nuxt2 and uses js, why is this happening?

Here is my package.json

{
  "name": "unocss-test",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
    "lint:prettier": "prettier --check .",
    "lint": "yarn lint:js && yarn lint:prettier",
    "lintfix": "prettier --write --list-different . && yarn lint:js --fix"
  },
  "dependencies": {
    "core-js": "^3.25.3",
    "element-ui": "^2.15.10",
    "nuxt": "^2.15.8",
    "vue": "^2.7.10",
    "vue-server-renderer": "^2.7.10",
    "vue-template-compiler": "^2.7.10"
  },
  "devDependencies": {
    "@babel/eslint-parser": "^7.19.1",
    "@nuxtjs/eslint-config": "^11.0.0",
    "@nuxtjs/eslint-module": "^3.1.0",
    "@unocss/nuxt": "^0.61.8",
    "eslint": "^8.24.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-nuxt": "^4.0.0",
    "eslint-plugin-vue": "^9.5.1",
    "nuxi": "^3.12.0",
    "prettier": "^2.7.1",
    "unocss": "^0.61.9"
  }
}

Reproduction

It seems that as long as it is nuxt2+unocss, this problem will occur

@nuxt/unocss version 0.45.1

image

@nuxt/unocss version 0.33.1

without any problem

System Info

windows 11

Validations

Simonmie commented 3 months ago

I'm confused because it seems that a specific version might have this issue, but some versions don't. Just now, I used version 0.60.3, and this problem didn't occur. 我很疑惑,好像特定版本会出现这个,但有些版本就不会,刚刚使用了0.60.3,就不会出现这个问题

antfu commented 3 months ago

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info. Please provide a minimal reproduction to reopen the issue. Thanks.

Why reproduction is required

Simonmie commented 3 months ago

ok,I will

---- Replied Message ---- | From | Anthony @.> | | Date | 08/01/2024 19:14 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [unocss/unocss] 【BUG】Cannot find module 'uno.css' ,It seems that the new version will have adaptation issues (Issue #4038) |

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info. Please provide a minimal reproduction to reopen the issue. Thanks.

Why reproduction is required

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Simonmie commented 3 months ago

unocss-test.zip This is a simple demo for the problem

Simonmie commented 3 months ago

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info.由于缺乏足够的信息,我们暂时关闭了此功能。我们无法确定这是一个错误还是给定信息的用户空间配置错误。 Please provide a minimal reproduction to reopen the issue.请提供最小的复制品以重新打开问题。 Thanks. 谢谢。

Why reproduction is required为什么需要繁殖

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info.由于缺乏足够的信息,我们暂时关闭了此功能。我们无法确定这是一个错误还是给定信息的用户空间配置错误。 Please provide a minimal reproduction to reopen the issue.请提供最小的复制品以重新打开问题。 Thanks. 谢谢。

Why reproduction is required为什么需要繁殖

unocss-test.zip

This is a simple demo for the problem

adcGG commented 3 months ago

我也遇到这个问题了,我试了很多版本 发现在0.58.5之后(不包括0.58.5)就开始出现 Cannot find ... uno.css 目前我的 nuxt2+unocss, 主要是这几个包和版本 "@unocss/nuxt": "^0.58.5", "nuxt": "^2.15.8",

Simonmie commented 3 months ago

我也遇到这个问题了,我试了很多版本 发现在0.58.5之后(不包括0.58.5)就开始出现 Cannot find ... uno.css 目前我的 nuxt2+unocss, 主要是这几个包和版本 "@unocss/nuxt": "^0.58.5", "nuxt": "^2.15.8",

目前可能最接近新的版本的是0.60.3,你可以试试

adcGG commented 3 months ago

我也遇到这个问题了,我试了很多版本 发现在0.58.5之后(不包括0.58.5)就开始出现 Cannot find ... uno.css 目前我的 nuxt2+unocss, 主要是这几个包和版本 "@unocss/nuxt": "^0.58.5", "nuxt": "^2.15.8",

目前可能最接近新的版本的是0.60.3,你可以试试

我试过了,会报同样的问题~ 我在 unocss 官网的示例,看到是两年前的提交记录,我找到那会的包的版本,大概是0.30..

我创建了一个单独的nuxt2项目,然后尝试安装 unocss 和 @unocss/nuxt, 0.30版本的,是能够使用的,没有报错 后面尝试了几次之后,在0.58.6之后开始报错了,最新的0.60.3也是报错的

所以我现在用0.58.5版本的,目前是够用的