0

I have an external loader animation dependency installed in node modules. When i run it on local everything works fine but after deploying the app i get that the script for this module is not found ("GET /lottie-player.js.map" Error (404): "Not found")

angular.json

"architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "aot": true,
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/assets/i18n"
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": [
              "./node_modules/@lottiefiles/lottie-player/dist/lottie-player.js"
            ]
          },

scripts.js (in dist folder)

{
  "version":3,
  "sources":["node_modules/@lottiefiles/lottie-player/dist/lottie-player.js"],   // error thrown is that it can't get lottie-player.js
  "names":[],
  "mappings"
}

Is there any other of way of adding scripts?

Pablo G
  • 199
  • 12
  • .map file is sourceMap file. sourcemaps are not allowed in aot. why your lottie-player.js wants its map file? – Aakash Garg Jun 09 '20 at 13:10
  • `scripts.js` in dist folder? As far as I know, Angular does not generate a `scripts.js` file in the dist folder... There's `runtime.js`, `vendor.js`, `polyfill.js`, but not `scripts`. This is odd... How do you compile your app? – Jeremy Thille Jun 09 '20 at 13:13
  • @AakashGarg i followed an answer here on how to install lottie player. https://stackoverflow.com/questions/56825421/install-lottie-player-to-angular/60971710#60971710 – Pablo G Jun 09 '20 at 13:14
  • @JeremyThille and where can I put the scripts then? – Pablo G Jun 09 '20 at 13:15
  • Well, _you_ don't put the script in the dist folder. The dist folder is generated by Angular, that's your final product. You only tinker with the `src` folder – Jeremy Thille Jun 09 '20 at 13:36

0 Answers0