Unable to build module-federation example

オープン
#7 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, node.js, webpack

調査の方向性

app1/webpack.config.mjs から始め、そこにある本番コマンドを、動作している host と app2 の設定と比較します。yarn run bootstrap の後に再現し、その後 @callstack/repack 内で報告された AssetsCopyProcessor.enqueueChunk のパスを追跡します。app1 と module1 の両方で同じ本番コマンドが undefined パスのエラーなしに正常終了すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Environment

System
  platform           darwin                                                           
  arch               arm64                                                            
  cpu                10 cores          Apple M1 Pro                                   
  Node.js v18.9.1
  yarn v3.2.1

Description

Unable to build module-federation example for production.

I have been able to run the module-federation example on dev but I have been trying to change the implementation to an actual production level code. So I started to build production bundles for each of the modules.

I have been able to produce release bundles for host and app2 MFs using the following command:

STANDALONE=1 webpack -c webpack.config.mjs --env platform=ios --env mode=production

But when trying to run the same command on app1 and module1 MFs, I am getting the following error:

[webpack-cli] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

Reproducible Demo

git clone https://github.com/callstack/repack-examples
cd repack-examples
yarn run bootstrap
cd app1
npx STANDALONE=1 webpack -c webpack.config.mjs --env platform=ios --env mode=production

Output

[webpack-cli] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (internal/errors.js:322:7)
    at validateString (internal/validators.js:124:11)
    at Object.join (path.js:1148:7)
    at AssetsCopyProcessor.enqueueChunk (/Users/parichitkotawala/Development/RN/repack-examples/module-federation/module1/node_modules/@callstack/repack/dist/webpack/plugins/utils/AssetsCopyProcessor.js:53:70)
    at /Users/parichitkotawala/Development/RN/repack-examples/module-federation/module1/node_modules/@callstack/repack/dist/webpack/plugins/OutputPlugin.js:225:55
    at Hook.eval [as callAsync] (eval at create (/Users/parichitkotawala/Development/RN/repack-examples/module-federation/module1/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:8:17)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/parichitkotawala/Development/RN/repack-examples/module-federation/module1/node_modules/tapable/lib/Hook.js:18:14)
    at /Users/parichitkotawala/Development/RN/repack-examples/module-federation/module1/node_modules/webpack/lib/Compiler.js:882:27
    at /Users/parichitkotawala/Development/RN/repack-examples/module-federation/module1/node_modules/neo-async/async.js:2818:7
    at done (/Users/parichitkotawala/Development/RN/repack-examples/module-federation/module1/node_modules/neo-async/async.js:3522:9)
    at alreadyWritten (/Users/parichitkotawala/Development/RN/repack-examples/module-federation/module1/node_modules/webpack/lib/Compiler.js:714:8)
    at /Users/parichitkotawala/Development/RN/repack-examples/module-federation/module1/node_modules/webpack/lib/Compiler.js:802:19
    at /Users/parichitkotawala/Development/RN/repack-examples/module-federation/module1/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:71:3) {
  code: 'ERR_INVALID_ARG_TYPE'
}
主要言語
Java
スター
69
フォーク
23
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstack/repack-examples のほかの issue

callstack/repack-examples の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。