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

Windows環境でswcでビルドすると実行できない #10073

Closed
kabo2468 opened this issue Feb 24, 2023 · 2 comments · Fixed by #10074
Closed

Windows環境でswcでビルドすると実行できない #10073

kabo2468 opened this issue Feb 24, 2023 · 2 comments · Fixed by #10074
Labels
⚠️bug? This might be a bug

Comments

@kabo2468
Copy link
Contributor

💡 Summary

Windows環境でswcでビルドするとパスの解決がうまくできずにビルドされて実行できない

backend/built/boot/index.js

/**
 * Misskey Entry Point!
 */ import cluster from "node:cluster";
import { EventEmitter } from "node:events";
import chalk from "chalk";
import Xev from "xev";
import Logger from "//?/H:/Works/misskey/packages/backend/src/logger.js";
import { envOption } from "../env.js";
import { masterMain } from "./master.js";
import { workerMain } from "./worker.js";

🥰 Expected Behavior

正常に実行できる

🤬 Actual Behavior

pnpm migrate

> misskey@13.7.1 migrate H:\Works\misskey
> cd packages/backend && pnpm migrate


> backend@ migrate H:\Works\misskey\packages\backend
> pnpm typeorm migration:run -d ormconfig.js

Error during migration run:
Error: Unable to open file: "H:\Works\misskey\packages\backend\ormconfig.js". File URL path must be absolute
    at CommandUtils.loadDataSource (H:\Works\misskey\node_modules\.pnpm\typeorm@0.3.11_ioredis@4.28.5+pg@8.9.0\node_modules\typeorm\commands\CommandUtils.js:22:19)
    at async Object.handler (H:\Works\misskey\node_modules\.pnpm\typeorm@0.3.11_ioredis@4.28.5+pg@8.9.0\node_modules\typeorm\commands\MigrationRunCommand.js:41:26)
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

pnpm start

> misskey@13.7.1 start H:\Works\misskey
> cd packages/backend && node ./built/boot/index.js

node:internal/errors:490
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must be absolute
    at new NodeError (node:internal/errors:399:5)
    at getPathFromURLWin32 (node:internal/url:1463:11)
    at fileURLToPath (node:internal/url:1493:22)
    at finalizeResolution (node:internal/modules/esm/resolve:296:14)
    at moduleResolve (node:internal/modules/esm/resolve:945:10)
    at defaultResolve (node:internal/modules/esm/resolve:1153:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40) {
  code: 'ERR_INVALID_FILE_URL_PATH'
}

Node.js v18.14.1
 ELIFECYCLE  Command failed with exit code 1.

📝 Steps to Reproduce

1.pnpm clean
2.pnpm i
3.pnpm build
4.pnpm migrate or pnpm start

📌 Environment

Misskey version: 4e23500 ~(swcを使うコミットから)
Your OS: Windows 10 (No WSL)

@kabo2468 kabo2468 added the ⚠️bug? This might be a bug label Feb 24, 2023
@kabo2468
Copy link
Contributor Author

swc v1.3.36で直ってるかも
swc-project/swc#6930

@kabo2468
Copy link
Contributor Author

直った

/**
 * Misskey Entry Point!
 */ import cluster from "node:cluster";
import { EventEmitter } from "node:events";
import chalk from "chalk";
import Xev from "xev";
import Logger from "../logger.js";
import { envOption } from "../env.js";
import { masterMain } from "./master.js";
import { workerMain } from "./worker.js";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant