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

[Misskey 2023.12.0-beta.1] pnpm clean-all後、Misskeyが起動しない #12528

Closed
shiosyakeyakini-info opened this issue Nov 30, 2023 · 8 comments · Fixed by #12536
Closed
Labels
⚠️bug? This might be a bug

Comments

@shiosyakeyakini-info
Copy link
Contributor

shiosyakeyakini-info commented Nov 30, 2023

💡 Summary

pnpm clean-all pnpm install pnpm build pnpm migrateを行ったあと、pnpm devでMisskeyが起動しません。

Viteによって表示されるエラーは下記のとおりです。

Error:   Failed to scan for dependencies from entries:
  /workspace/packages/frontend/src/_boot_.ts

  ✘ [ERROR] No loader is configured for ".json5" files: src/themes/_dark.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/_light.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/d-astro.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/d-botanical.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/d-cherry.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/d-dark.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/d-future.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/d-green-lime.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/d-green-orange.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/d-ice.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/d-persimmon.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/d-u0.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/l-apricot.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/l-botanical.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/l-cherry.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/l-coffee.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/l-light.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/l-rainy.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/l-sushi.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/l-u0.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] No loader is configured for ".json5" files: src/themes/l-vivid.json5

    src/scripts/theme.ts:48:22:
      48 │ ...map(name => import(`../themes/${name}.json5`).then(({ default: ...
         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~


    at failureErrorWithLog (/workspace/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1650:15)
    at /workspace/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1058:25
    at runOnEndCallbacks (/workspace/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1485:45)
    at buildResponseToResult (/workspace/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1056:7)
    at /workspace/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1068:9
    at new Promise (<anonymous>)
    at requestCallbacks.on-end (/workspace/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1067:54)
    at handleRequest (/workspace/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:731:17)
    at handleIncomingPacket (/workspace/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:756:7)
    at Socket.readFromStdout (/workspace/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:679:7)

ここで、theme.tsの該当箇所

	].map(name => import(`../themes/${name}.json5?import`).then(({ default: _default }): Theme => _default)),

のようにファイルの拡張子のあとに?importをつけると起動するようになります。一度これで起動すると、その後はこの差分を削除してもとに戻しても、次にクリーンするまでは起動するようです。

🥰 Expected Behavior

devcontainerでMisskeyが起動する

🤬 Actual Behavior

devcontainerでMisskeyが起動しない

📝 Steps to Reproduce

  1. pnpm clean pnpm install pnpm build pnpm migrateを行う
  2. pnpm devでMisskeyを起動する

💻 Frontend Environment

* Model and OS of the device(s): macOS Ventura 13.5.1
* Browser: Chrome 119.0
* Server URL: localhost
* Misskey: 2023.12.0-beta.1 (developブランチ)

🛰 Backend Environment (for server admin)

* Installation Method or Hosting Service: development environment (devcontainer)
* Misskey: 2023.12.0-beta.1 (developブランチの12/1時点)
* Node: v20.10.0
* PostgreSQL:
* Redis:
* OS and Architecture: macOS Ventura 13.5.1
@shiosyakeyakini-info shiosyakeyakini-info added the ⚠️bug? This might be a bug label Nov 30, 2023
@tai-cha
Copy link
Contributor

tai-cha commented Nov 30, 2023

devcontainer環境でなく普通に(wsl2にnodenv載せた環境の)nodeを動かしている場合でも再現する

@samunohito
Copy link
Member

...map(name => import(`../themes/${name}.json5`).then(({ default: ...

ためしにフルパスでやったら上手くいったので、パス解決に難があるのかもしれません。
たぶん、packages/frontendじゃなくてリポジトリのルートにいる状態になっているのではないかなと…

以下でエラーが出なくなりました

].map(name => import(`${__dirname}/../themes/${name}.json5`).then(({ default: _default }): Theme => _default)),

@samunohito
Copy link
Member

(プルリクするか…)

@samunohito samunohito self-assigned this Dec 1, 2023
samunohito added a commit to samunohito/misskey that referenced this issue Dec 1, 2023
@samunohito samunohito mentioned this issue Dec 1, 2023
5 tasks
syuilo pushed a commit that referenced this issue Dec 2, 2023
samunohito added a commit to samunohito/misskey that referenced this issue Dec 3, 2023
@samunohito samunohito removed their assignment Dec 3, 2023
@samunohito
Copy link
Member

プルリクのrevertにより、別案を考える必要あり

@samunohito samunohito reopened this Dec 3, 2023
@shiosyakeyakini-info
Copy link
Contributor Author

?importをつけてるとテーマの画面は開けてた(それもかなり謎)

@samunohito
Copy link
Member

__dirname、CommonJS限定だったとは…無知が露呈してしまいました(フロントエンドはESModuleとしてビルドされている)

以下が代替になるかも…?
https://teno-hira.com/media/?p=1615

@syuilo syuilo closed this as completed in 5ccd61b Dec 3, 2023
@samunohito
Copy link
Member

(GitHubの機能により勝手に閉じられてしまった…?)

@samunohito
Copy link
Member

@shiosyakeyakini-info
↑の対応で(こんどこそ)出来るようになったはずなので、closeします。
また何かあったらreopenいただけると幸いです

camilla-ett pushed a commit to kaseiski/misskey that referenced this issue Jan 2, 2024
camilla-ett pushed a commit to kaseiski/misskey that referenced this issue Jan 2, 2024
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.

3 participants