0

So basically there is a host app which is gets remote microfrontend files from another firebase url.

So remote app is hosted on firebase such as www.firebas-ipsum.web.app.

When host application tries to get file www.firebas-ipsum.web.app/remoteEntry.js as expected we received CORS error.

How can we enable CORS for fetching any files? I tried solution in CORS issue but it is for requests, not for files.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Vugar Abdullayev
  • 1,852
  • 3
  • 21
  • 46

1 Answers1

0

Found solution by adding headers to firebase.json.

{
  "hosting": {
    "public": "dist",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ],
    "headers": [
      {
        "source": "**/**",
        "headers": [
          {
            "key": "Access-Control-Allow-Origin",
            "value": "*"
          }
        ]
      }
    ]
  }
}

For more information Offical Docs

Vugar Abdullayev
  • 1,852
  • 3
  • 21
  • 46