2

I have an issue when running my nx site locally, where any federated app that uses signalR has started throwing a ChunkLoadError.

I've tried changing the version of signalR, reloading, clearing cache and running my federated app individually. The result is always the same.

Uncaught TypeError: Failed to resolve module specifier "module". Relative references must start with either "/", "./", or "../".

and

ChunkLoadError: Loading chunk vendors-node_modules_microsoft_signalr_dist_esm_index_js failed.

Has anyone faced a similar issue with signalR?

When I check the dependencies for the project, it appears to be missing signalR

enter image description here

enter image description here

Here is a repo that I've created to demo the issue: https://github.com/LeonieNFarmer/nxv16.5.3withsignalr

Leo Farmer
  • 7,730
  • 5
  • 31
  • 47

2 Answers2

1

It seems your Federated app is missing a correct usage of an import map which means bare module specifier can’t be handled. I suggest you have a look at one of the official examples to see how it looks like: signalR samples

Syed Mustaqhim
  • 453
  • 3
  • 13
0
  1. make sure you use the same node version that worked previously for the project.
  2. Did you accidentally install signalR globally? uninstall it. then run npm install again in your project to update your node_modules and package-lock. Because currently your package-lock.json does not contain any reference to signalR. In general you may want to check if you installed packages globally that are not required to be installed globally. you can check what you installed globally with npm list -g --depth 0. Do you run behind a company proxy? this may cause issues when you run npm install because postinstall scripts of npm modules can fail.
  3. npm cache clean does not really work for new npm versions. you have to delete the npm cache folder instead, e.g. for windows you can find it in %localappdata%\npm-cache. new npm versions may say "you dont need to fix the cache anymore because everything works flawlessly now", but i already fixed problems in the past by deleting that folder.
Welcor
  • 2,431
  • 21
  • 32