Angular-cli "Unknown option: '--sourceMap' when using '--project'
See original GitHub issue🐞 Bug report
Command (mark with an x)
- [ ] new
- [X ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Description
A clear and concise description of the problem...ng build --sourceMap --watch works.
ng build --project mylib --sourceMap --watch does not work
🔬 Minimal Reproduction
- Create an app
ng new myapp(yes routing, SASS) - cd to the folder
- Create a new library
ng generate library my-new-lib - Run
ng build --sourceMap, this works (I know this is default behavior, put it on false also works). - Run
ng build my-new-lib --sourceMap - Get the error: `Unknown option: ‘–sourceMap’
Also tried all of the similar commands that I know or found on the internet:
--source-map
--vendor-source-map
--vendorSourceMap
🔥 Exception or Error
Unknown option: '--sourceMap'
🌍 Your Environment
Angular CLI: 7.3.8
Node: 8.9.4
OS: win32 x64
Angular: 7.2.12
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.13.8
@angular-devkit/build-angular 0.13.8
@angular-devkit/build-ng-packagr 0.13.8
@angular-devkit/build-optimizer 0.13.8
@angular-devkit/build-webpack 0.13.8
@angular-devkit/core 7.3.8
@angular-devkit/schematics 7.3.8
@angular/cli 7.3.8
@ngtools/json-schema 1.1.0
@ngtools/webpack 7.3.8
@schematics/angular 7.3.8
@schematics/update 0.13.8
ng-packagr 4.7.1
rxjs 6.3.3
typescript 3.2.4
webpack 4.29.0
Anything else relevant?
A suggested option was to change the angular.json and include "vendorSourceMap" : true within my-new-lib > architect -> build -> options, but that gives the following error:
Schema validation failed with the following errors:
Data path "" should NOT have additional properties(vendorSourceMap).
Another option is to change the tsconfig.json. But after doing that, I get the error an application startup Cannot Get / (which is btw the best possible error message to debug -.-)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
Angular CLI "Unknown option: '--sourcemap'" error
I try to enable source maps in my Angular-Sass project with these commands: ng serve -sm -ec ng serve --sourcemap --extract-css ng serve ......
Read more >ng build - Angular
Option Description Value Type Default Value
‑‑aot Build using Ahead of Time compilation. boolean true
‑‑base‑href Base url for the application being built. string
‑‑delete‑output‑path Delete...
Read more >Angular CLI - ng build Command - Tutorialspoint
Sr.No. Option & Syntax Description
2 ‑‑baseHref=baseHref Base url for the application being built.
9 ‑‑deployUrl=deployUrl URL where files will be deployed.
17 ‑‑localize=true|false
Read more >angular/angular-cli - Gitter
anyway I found it, in angular.json, set "options" -> "configurations" -> "sourceMap": true. but I still prefer an option in "ng build" command....
Read more >Angular CLI 6 Unknown option: '–singleRun' – iTecNote
ng test --source-map=false --single-run --no-progress --browsers=ChromeNoSandbox ... With older versions of angular-cli, you used to be able to use both ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You need to set a
sourceMapproperty under thebuildtarget options of your app in theangular.jsonThis issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.