title: Angular 11 facing issues loading js files: Uncaught SyntaxError: Cannot use import statement outside a module
body: <p>when i load js files in angular.json file facing issues in Uncaught SyntaxError: Cannot use import statement outside a module</p>
  <p>Ref angular.json</p>
  <pre><code>&quot;styles&quot;: [
                &quot;src/assets/scss/app.scss&quot;,
                &quot;src/styles.scss&quot;
              ],
              &quot;scripts&quot;: [
                &quot;src/assets/js/app.js&quot;
              ]
  </code></pre>
  <p>tsconfig.json file</p>
  <pre><code>{
    &quot;compileOnSave&quot;: false,
    &quot;compilerOptions&quot;: {
      &quot;baseUrl&quot;: &quot;./&quot;,
      &quot;outDir&quot;: &quot;./dist/out-tsc&quot;,
      &quot;forceConsistentCasingInFileNames&quot;: true,
      &quot;strict&quot;: true,
      &quot;noImplicitReturns&quot;: true,
      &quot;noFallthroughCasesInSwitch&quot;: true,
      &quot;sourceMap&quot;: true,
      &quot;declaration&quot;: false,
      &quot;downlevelIteration&quot;: true,
      &quot;experimentalDecorators&quot;: true,
      &quot;moduleResolution&quot;: &quot;node&quot;,
      &quot;importHelpers&quot;: true,
      &quot;target&quot;: &quot;es2015&quot;,
      &quot;module&quot;: &quot;es2020&quot;,
      &quot;esModuleInterop&quot;: true,
      &quot;lib&quot;: [
        &quot;es2018&quot;,
        &quot;dom&quot;
      ]
    },
    &quot;angularCompilerOptions&quot;: {
      &quot;enableI18nLegacyMessageIdFormat&quot;: false,
      &quot;strictInjectionParameters&quot;: true,
      &quot;strictInputAccessModifiers&quot;: true,
      &quot;strictTemplates&quot;: true
    }
  }
  
  
  </code></pre>