Failed to load module script

One possible explanation for the error:
You get this behavior when you deploy your app into a subfolder, not directly on your base-URL.

What happens:

  • The HTML is found when you go to www.yourbase.com/yoursubfolder/index.html, but the angular app fetches resources with relative path (let’s say resource.css) from www.yourbase.com/resource.css instead of from www.yourbase.com/yoursubfolder/resource.css
  • your webserver probably serves some default page onwww.yourbase.com/resource.css (maybe your www.yourbase.com/index.html)
  • So the content of that default page is loaded instead of your CSS.

To fix it

Build your angular app with

ng build --prod --base-href yoursubfolder

Or set the base path in your index.html

<head>
    <base href="/yoursubfolder/">
</head>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)