manfredsteyer / ngx-build-plus

Extend the Angular CLI's default build behavior without ejecting, e. g. for Angular Elements
1.19k stars 136 forks source link

Unable to serve language files with MFE. #396

Open curiousdev opened 11 months ago

curiousdev commented 11 months ago

Can you provide some guidance on the following situation? My MFE builds and runs just fine with our CDN, but something about the localhost developer experience is broken. I'm sure it's a misconfiguration, but I can't see it.

Is there a specific configuration needed to serve the language files. Apologies if this is the wrong repository, happy to re-post in the correct place.

My javascript artifacts and json artifacts built successfully into the repo's dist folder.

> ls dist/mytest-mfe/remoteEntry* 
  dist/mytest-mfe/remoteEntry.js
  dist/mytest-mfe/remoteEntry.js.map

> ls dist/mytest-mfe/assets/i18n/en.json
  en.json

Moreover, I can successfully can curl 200 for the javascript remoteEntry.js

> curl -vvv http://localhost:3000/remoteEntry.js     
> GET /remoteEntry.js HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 200 OK
...large...javascript...body...redacted...

However, I cannot curl the langauge en.json file.

curl -vvv http://localhost:3000/assets/i18n/en.json
> GET /assets/i18n/en.json HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Content-Length: 158
< 
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /assets/i18n/en.json</pre>
</body>
</html>