module-federation-examples icon indicating copy to clipboard operation
module-federation-examples copied to clipboard

Remix example start command fails

Open rdenman opened this issue 1 year ago • 0 comments

The remix example crashes on startup (build is fine) with the following error:

app1 start: /Users/rob.denman/workspace/module-federation-examples/remix/app1/build/index.js:5225
app1 start: /******/                    __webpack_require__.federation.bundlerRuntime.remotes({idToRemoteMap,chunkMapping, idToExternalAndNameMapping, chunkId, promises, webpackRequire:__webpack_require__});
app1 start:                                                                           ^
app1 start: TypeError: Cannot read properties of undefined (reading 'remotes')
app1 start:     at __webpack_require__.f.remotes (/Users/rob.denman/workspace/module-federation-examples/remix/app1/build/index.js:5225:59)
app1 start:     at /Users/rob.denman/workspace/module-federation-examples/remix/app1/build/index.js:5681:95
app1 start:     at Object.<anonymous> (/Users/rob.denman/workspace/module-federation-examples/remix/app1/build/index.js:5693:12)
app1 start:     at Module._compile (node:internal/modules/cjs/loader:1368:14)
app1 start:     at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
app1 start:     at Module.load (node:internal/modules/cjs/loader:1205:32)
app1 start:     at Module._load (node:internal/modules/cjs/loader:1021:12)
app1 start:     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12)
app1 start:     at node:internal/main/run_main_module:28:49
app1 start: Node.js v21.7.2
app1 start: Failed

Reproduction:

  • Clone the repo
  • Change to the remix directory
  • Run pnpm install
  • Run pnpm start

Note that app2 starts fine on it's own. app1 will start fine if the federated import is removed (import Button from 'app2/button';)

rdenman avatar Jul 03 '24 17:07 rdenman