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

Error in systems other than Windows #119

Closed
ckvv opened this issue Sep 30, 2022 · 14 comments
Closed

Error in systems other than Windows #119

ckvv opened this issue Sep 30, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@ckvv
Copy link

ckvv commented Sep 30, 2022

错误信息

failed to load config from /Users/chenkai/github/ckpack/v-ui/scripts/vite.es.ts
error during build:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/chenkai/github/ckpack/v-ui/node_modules/@microsoft/api-extractor/lib/collector/Collector' imported from /Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.js
Did you mean to import @microsoft/api-extractor/lib/collector/Collector.js?
    at new NodeError (node:internal/errors:393:5)
    at finalizeResolution (node:internal/modules/esm/resolve:323:11)
    at moduleResolve (node:internal/modules/esm/resolve:916:10)
    at defaultResolve (node:internal/modules/esm/resolve:1124:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:837:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36)
 ELIFECYCLE  Command failed with exit code 1.

复现地址https://github.com/ckpack/v-ui

@ckvv
Copy link
Author

ckvv commented Sep 30, 2022

应该是这个字段导致的 https://github.com/qmhc/vite-plugin-dts/blob/main/package.json#L99

@qmhc
Copy link
Owner

qmhc commented Sep 30, 2022

你可以尝试一下最新的 1.6.3 版本是否还存在这个问题。

@ckvv
Copy link
Author

ckvv commented Sep 30, 2022

又有其他问题了

failed to load config from /Users/chenkai/github/ckpack/v-ui/scripts/vite.es.ts
error during build:
ReferenceError: __filename is not defined in ES module scope
    at isFileSystemCaseSensitive (file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:11047:46)
    at getNodeSystem (file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:10812:46)
    at file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:11367:20
    at file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:11374:8
    at file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:11389:4
    at file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:172321:3
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:526:24)
    at async loadConfigFromBundledFile (file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:63495:21)
 ELIFECYCLE  Command failed with exit code 1

@qmhc
Copy link
Owner

qmhc commented Sep 30, 2022

麻烦你发一下你的 vite 配置和 package.json

@ckvv
Copy link
Author

ckvv commented Sep 30, 2022

@qmhc
Copy link
Owner

qmhc commented Sep 30, 2022

我克隆下来能够正常的打包,或许有一些缓存,你尝试重新初始化项目看看。

image

@ckvv
Copy link
Author

ckvv commented Sep 30, 2022

现在的版本是1.6.1,你需要手动改成1.6.3

@qmhc
Copy link
Owner

qmhc commented Sep 30, 2022

是在 1.6.3 版本下运行的,因为是 ^ 没有锁版本,会安装最新版,已经确认过了。

image

@ckvv
Copy link
Author

ckvv commented Sep 30, 2022

pnpm-lock.yaml 不就是锁版本的么!! 把^删除了试试?

@qmhc
Copy link
Owner

qmhc commented Sep 30, 2022

我已经确定了在我本地的环境下你的这个项目在 1.6.3 版本不会报错,请你按重新初始化项目尝试后再反馈,如果依旧出错,我们再进一步讨论可能是一些系统环境、node 版本之类导致的问题。

lock 锁的是内部依赖,这个插件是你的直接依赖,会根据你的版本号规则更新 lock 文件。

@ckvv
Copy link
Author

ckvv commented Sep 30, 2022

我的node版本是v18.10.0

就有这个问题了!

@qmhc
Copy link
Owner

qmhc commented Sep 30, 2022

image

依然无法复现。

@hrachhovsepyanqless
Copy link

又有其他问题了

failed to load config from /Users/chenkai/github/ckpack/v-ui/scripts/vite.es.ts
error during build:
ReferenceError: __filename is not defined in ES module scope
    at isFileSystemCaseSensitive (file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:11047:46)
    at getNodeSystem (file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:10812:46)
    at file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:11367:20
    at file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:11374:8
    at file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:11389:4
    at file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite-plugin-dts/dist/index.mjs:172321:3
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:526:24)
    at async loadConfigFromBundledFile (file:///Users/chenkai/github/ckpack/v-ui/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:63495:21)
 ELIFECYCLE  Command failed with exit code 1

I have the same issue, FYI. I've tried updating vite to the latest version, but it didn't help. I'm using yarn 1.22.19 and node 16.15.

@ckvv
Copy link
Author

ckvv commented Sep 30, 2022

https://github.com/ckpack/v-ui/actions/runs/3157722087/jobs/5138925974
github action 有相同的错误 可能只有windows下是正常的
截屏2022-09-30 17 29 36

@qmhc qmhc added pending Need further confirmation bug Something isn't working and removed pending Need further confirmation labels Sep 30, 2022
@qmhc qmhc changed the title 新版本打包失败1.6.2 回退到1.6.1正常 Error in systems other than Windows Sep 30, 2022
@qmhc qmhc closed this as completed in 57e093d Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants