You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D:\nodejs\node_global\pnpm.cmd run dev
> @halo-dev/console@2.11.0 dev E:\halo\halo\console
> run-p dev:console dev:uc
> @halo-dev/console@2.11.0 dev:console E:\halo\halo\console
> vite --host --config ./vite.config.ts
> @halo-dev/console@2.11.0 dev:uc E:\halo\halo\console
> vite --host --config ./vite.uc.config.ts
ERROR failed to load config from E:\halo\halo\console\vite.config.ts 15:39:25
ERROR error when starting dev server: 15:39:25
TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
at new NodeError (node:internal/errors:405:5)
at fileURLToPath (node:internal/url:1436:11)
at createViteConfig (E:\halo\halo\console\vite.config.ts:194:44)
at vite_config_default (E:\halo\halo\console\vite.config.ts:205:10)
at loadConfigFromFile (file:///E:/halo/halo/console/node_modules/.pnpm/vite@4.2.3_@types+node@18.13.0_sass@1.60.0/node_modules/vite/dist/node
/chunks/dep-f2591f42.js:63855:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async resolveConfig (file:///E:/halo/halo/console/node_modules/.pnpm/vite@4.2.3_@types+node@18.13.0_sass@1.60.0/node_modules/vite/dist/nod
e/chunks/dep-f2591f42.js:63466:28)
at async createServer (file:///E:/halo/halo/console/node_modules/.pnpm/vite@4.2.3_@types+node@18.13.0_sass@1.60.0/node_modules/vite/dist/node
/chunks/dep-f2591f42.js:62752:20)
at async CAC.<anonymous> (file:///E:/halo/halo/console/node_modules/.pnpm/vite@4.2.3_@types+node@18.13.0_sass@1.60.0/node_modules/vite/dist/n
ode/cli.js:734:24)
ELIFECYCLE Command failed with exit code 1.
ERROR failed to load config from E:\halo\halo\console\vite.uc.config.ts 15:39:25
ERROR error when starting dev server: 15:39:25
TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
at new NodeError (node:internal/errors:405:5)
at fileURLToPath (node:internal/url:1436:11)
at createViteConfig (E:\halo\halo\console\vite.uc.config.ts:193:44)
at vite_uc_config_default (E:\halo\halo\console\vite.uc.config.ts:203:10)
at loadConfigFromFile (file:///E:/halo/halo/console/node_modules/.pnpm/vite@4.2.3_@types+node@18.13.0_sass@1.60.0/node_modules/vite/dist/node
/chunks/dep-f2591f42.js:63855:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async resolveConfig (file:///E:/halo/halo/console/node_modules/.pnpm/vite@4.2.3_@types+node@18.13.0_sass@1.60.0/node_modules/vite/dist/nod
e/chunks/dep-f2591f42.js:63466:28)
at async createServer (file:///E:/halo/halo/console/node_modules/.pnpm/vite@4.2.3_@types+node@18.13.0_sass@1.60.0/node_modules/vite/dist/node
/chunks/dep-f2591f42.js:62752:20)
at async CAC.<anonymous> (file:///E:/halo/halo/console/node_modules/.pnpm/vite@4.2.3_@types+node@18.13.0_sass@1.60.0/node_modules/vite/dist/n
ode/cli.js:734:24)
ELIFECYCLE Command failed with exit code 1.
ERROR: "dev:console" exited with 1.
ELIFECYCLE Command failed with exit code 1.
Process finished with exit code 1
D:\nodejs\node_global\pnpm.cmd run build
> @halo-dev/console@2.11.0 build E:\halo\halo\console
> run-s build:console build:uc
> @halo-dev/console@2.11.0 build:console E:\halo\halo\console
> vue-tsc --noEmit && vite build --config ./vite.config.ts
vite v4.2.3 building for production... 15:44:49
WARN <script src="/console/assets/vue/vue.global.3286e1b2.js">in"/index.html" can't be bundled without type="module" attribute 15:44:49 WARN <script src="/console/assets/vue-router/vue-router.global.3286e1b2.js"> in "/index.html" can't be bundled without type="module" attribute
WARN <script src="/console/assets/vue-demi/vue-demi.3286e1b2.js">in"/index.html" can't be bundled without type="module" attribute 15:44:49 WARN <script src="/console/assets/vueuse/vueuse.shared.iife.3286e1b2.js"> in "/index.html" can't be bundled without type="module" attribute
WARN <script src="/console/assets/vueuse/vueuse.core.iife.3286e1b2.js">in"/index.html" can't be bundled without type="module" attribute WARN <script src="/console/assets/vueuse/vueuse.components.iife.3286e1b2.js"> in "/index.html" can't be bundled without type="module" attribute
WARN <script src="/console/assets/vueuse/vueuse.router.iife.3286e1b2.js">in"/index.html" can't be bundled without type="module" attribute WARN <script src="/console/assets/components/halo-components.iife.3286e1b2.js"> in "/index.html" can't be bundled without type="module" attribu
te
WARN <script src="/console/assets/console-shared/halo-console-shared.iife.3286e1b2.js">in"/index.html" can't be bundled without type="module" attributetransforming (3) console-src\main.ts WARN Browserslist: caniuse-lite is outdated. Please run: 15:44:50 npx update-browserslist-db@latest Why you should do it regularly: https://github.com/browserslist/update-db#readme✓ 6 modules transformed. 15:44:51 ERROR [vite-plugin-pwa:build] Could not load E:\src/utils/api-client (imported by console-src/main.ts): ENOENT: no such file or directory, open'E:\src\utils\api-client' ERROR error during build: 15:44:51 Error: Could not load E:\src/utils/api-client (imported by console-src/main.ts): ENOENT: no such file or directory, open 'E:\src\utils\api-client
' ELIFECYCLE Command failed with exit code 1.ERROR: "build:console" exited with 1. ELIFECYCLE Command failed with exit code 1.
附加信息
No response
The text was updated successfully, but these errors were encountered:
#### What type of PR is this?
/kind bug
/area console
/milestone 2.11.x
#### What this PR does / why we need it:
修复在 Windows 平台下无法正常启动 Console 服务以及无法正常编译的问题。
<img width="1124" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/55edd00a-8e71-437e-8889-0fe4a43bb40b">
#### Which issue(s) this PR fixes:
Fixes#4874
#### Special notes for your reviewer:
在 Windows 平台下测试 `pnpm dev` 和 `pnpm build`,检查是否能够正常运行。
#### Does this PR introduce a user-facing change?
```release-note
None
```
是什么版本出现了此问题?
main
使用的什么数据库?
H2
使用的哪种方式运行?
Source Code
在线站点地址
No response
发生了什么?
运行和编译 console 时发生路径的处理问题
outDir:
外面 config.ts 中 resolve 成了绝对路径,但没有加上协议头,导致运行报错
halo/console/vite.config.ts
Line 12 in 747cab3
halo/console/src/vite/config-builder.ts
Line 73 in 747cab3
alias:
fileURLToPath 输出的是基于根路径的路径,最后在vite中会加上盘符,去
E:\src
访问了(很好奇为什么linux下不会去直接找根目录的/src)halo/console/src/vite/config-builder.ts
Lines 61 to 63 in 747cab3
相关日志输出
附加信息
No response
The text was updated successfully, but these errors were encountered: