angular-cli: scripts.bundle.js net::ERR_ABORTED
Bug Report or Feature Request (mark with an x)
- [x ] bug report -> please search issues before submitting
- [ ] feature request
Versions.
Angular CLI: 1.5.0 Node: 8.8.0 OS: darwin x64 Angular: 5.0.0 … animations, common, compiler, compiler-cli, core, forms … http, platform-browser, platform-browser-dynamic … platform-server, router
@angular/cli: 1.5.0 @angular/language-service: 4.4.4 @angular-devkit/build-optimizer: 0.0.32 @angular-devkit/core: 0.0.20 @angular-devkit/schematics: 0.0.35 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.8.0 @schematics/angular: 0.1.0 typescript: 2.4.2 webpack: 3.8.1
Repro steps.
When I run 'ng serve --aot` it gives me this error: GET http://localhost:4200/scripts.bundle.js net::ERR_ABORTED
and because I have included jquery it has problem referencing it. ERROR ReferenceError: $ is not defined
I checked Network on Dev tools and scripts.bundle.js is NOT FOUND
The log given by the failure.
Desired functionality.
Today I upgraded the project to angular@5 and angular-cli@1.5 . Prior to this, it did not happen.
Mention any other details that might be useful.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 38
- Comments: 40 (2 by maintainers)
Commits related to this issue
- fix(@ngtools/webpack): do not remove outDir from the configuration It would overwrite JavaScript files in the source directory. Even if its a virtual compiler host, this is still a BAD THING and Type... — committed to hansl/angular-cli by hansl 7 years ago
- fix(@ngtools/webpack): do not remove outDir from the configuration It would overwrite JavaScript files in the source directory. Even if its a virtual compiler host, this is still a BAD THING and Type... — committed to hansl/angular-cli by hansl 7 years ago
- fix(@ngtools/webpack): do not remove outDir from the configuration It would overwrite JavaScript files in the source directory. Even if its a virtual compiler host, this is still a BAD THING and Type... — committed to hansl/angular-cli by hansl 7 years ago
- fix(@ngtools/webpack): do not remove outDir It would overwrite JavaScript files in the source directory. Even if its a virtual compiler host, this is still a BAD THING and TypeScript complains. Fixe... — committed to hansl/angular-cli by hansl 6 years ago
- fix(@ngtools/webpack): do not remove outDir It would overwrite JavaScript files in the source directory. Even if its a virtual compiler host, this is still a BAD THING and TypeScript complains. Fixe... — committed to hansl/angular-cli by hansl 6 years ago
- fix(@ngtools/webpack): suppress warnings for overwriting files in tsc Since we're using a virtual filesystem, overwriting files by tsc does not affect actual files on the filesystem. This allows us t... — committed to hansl/angular-cli by hansl 6 years ago
- fix(@ngtools/webpack): suppress warnings for overwriting files in tsc Since we're using a virtual filesystem, overwriting files by tsc does not affect actual files on the filesystem. This allows us t... — committed to angular/angular-cli by hansl 6 years ago
- fix(@ngtools/webpack): suppress warnings for overwriting files in tsc Since we're using a virtual filesystem, overwriting files by tsc does not affect actual files on the filesystem. This allows us t... — committed to angular/angular-cli by hansl 6 years ago
- fix(@ngtools/webpack): suppress warnings for overwriting files in tsc Since we're using a virtual filesystem, overwriting files by tsc does not affect actual files on the filesystem. This allows us t... — committed to angular/angular-cli by hansl 6 years ago
- fix(@ngtools/webpack): suppress warnings for overwriting files in tsc Since we're using a virtual filesystem, overwriting files by tsc does not affect actual files on the filesystem. This allows us t... — committed to d2clouds/speedray-cli by hansl 6 years ago
This happens when you use Electron and change index.html
<base href="/">to<base href="./">Just add useHash:true in your route module
I got the same error updating angular 4 to 5 and cli 1.4.7 to 1.5 I fixed it running:
npm cache verifyI hope that will solve your problem too.I had the same issue. Running
npm cache cleanseems to have resolved it.For me, the error only appears in the following situation: Using
ng servewith no flags The first compilation fails (due to a compile error) Subsequent build passes (compile error fixed) ==> the scripts.bundle.js file is not generated.When I abort the
ng servecommand and restart it, the file is generated as expected.Node: 6.11.2 Npm: 5.5.1 Typescript: 2.3.4 @angular/cli: 1.5.0 (also occurred in 1.4.9)
Same here. I did not use AOT on serve.
same here. I am also facing the same
Just to increase the number of times this solution appears:
It looks to be an issue with caching. Run:
npm cache cleanornpm cache verify.That has solved it for me.
Same problem…
I was facing the same issue, solved by changing base href=“/” to “./” in index.html after build
resolved by updating angular cli to
"@angular/cli": "1.5.4"None of
npm cache cleanornpm cache verifydoesn’t solve the issue for me.Still have only 5 chunks generated ex:
chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered]chunk {main} main.bundle.js (main) 7.73 MB [initial] [rendered]chunk {polyfills} polyfills.bundle.js (polyfills) 1.75 MB [initial] [rendered]chunk {styles} styles.bundle.js (styles) 1.06 MB [initial] [rendered]chunk {vendor} vendor.bundle.js (vendor) 13.8 MB [initial] [rendered]I have the same issue GET http://localhost:4200/scripts.bundle.js net::ERR_ABORTED
Closing as resolved with the 1.6.7+. If the issue persists, please open a new issue detailing the problem.
confirm this was fixed after upgrading the CLI from 1.5.0 to 1.6.7
If you are uploading this to github pages: change “/” to “./” in any sheet or script tags in your built index.html and upload it like that
same here: angular cli:1.5.5 angular:5.0.5 node:9.1.0 typescript:2.6.2 webpack:3.8.1 npm cache clean or npm cache verify don’t work for me
I had the same problem, I solved it by updating node to latest version: https://nodejs.org/en/download/ then “npm cache --force clean” and then “npm install” 😃