angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Angular 10. Failed to parse SourceMap ... URL is not supported

Open alekcey0211 opened this issue 6 years ago • 6 comments

🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑

Please file any Angular Framework issues at: https://github.com/angular/angular/issues/new/choose

For the time being, we keep Angular issues in a separate repository.

🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑

After update from angular 9 to angular 10. I got very much warnings about "Failed to parse SourceMap ... URL is not supported" i run project with command "node --max-old-space-size=4096 ./node_modules/@angular/cli/bin/ng serve"

angular.json

	"client": {
		"root": "projects/client/",
		"sourceRoot": "projects/client/src",
		"projectType": "application",
		"prefix": "portal",
		"schematics": {
			"@schematics/angular:component": {
				"style": "scss",
				"spec": false
			},
			"@schematics/angular:class": {
				"spec": false
			},
			"@schematics/angular:directive": {
				"spec": false
			},
			"@schematics/angular:guard": {
				"spec": false
			},
			"@schematics/angular:module": {
				"spec": false
			},
			"@schematics/angular:pipe": {
				"spec": false
			},
			"@schematics/angular:service": {
				"spec": false
			}
		},
		"architect": {
			"build": {
				"builder": "@angular-devkit/build-angular:browser",
				"options": {
					"outputPath": "dist/client",
					"index": "projects/client/src/index.html",
					"main": "projects/client/src/main.ts",
					"polyfills": "projects/client/src/polyfills.ts",
					"tsConfig": "projects/client/tsconfig.app.json",
					"aot": true,
					"assets": [
						"projects/client/src/config.json",
						"projects/client/src/web.config",
						"projects/client/src/favicon.ico",
						"projects/client/src/manifest.json",
						"projects/client/src/assets",
						"projects/client/src/ru.json",
						"projects/client/src/en.json",
						{
							"glob": "**/*",
							"input": "node_modules/ngx-extended-pdf-viewer/assets/",
							"output": "/assets/"
						}
					],
					"styles": [
						"projects/core/src/styles/main.scss",
						"projects/core/src/styles/spreadsheet/xspreadsheet.scss",
						"projects/messaging/src/styles/main.scss"
					],
					"scripts": [
						"./node_modules/jspdf/dist/jspdf.min.js",
						"./node_modules/jspdf-autotable/dist/jspdf.plugin.autotable.js"
					],
					"allowedCommonJsDependencies": [
						"devextreme/ui/tabs",
						"globalize/number",
						...
					]
				},
				"configurations": {
					"production": {
						"fileReplacements": [
							{
								"replace": "projects/client/src/environments/environment.ts",
								"with": "projects/client/src/environments/environment.prod.ts"
							}
						],
						"optimization": true,
						"outputHashing": "all",
						"sourceMap": false,
						"extractCss": true,
						"namedChunks": false,
						"aot": true,
						"extractLicenses": true,
						"vendorChunk": false,
						"buildOptimizer": true,
						"serviceWorker": true,
						"ngswConfigPath": "projects/client/ngsw-config.json"
					},
					"production-ks": {
						"fileReplacements": [
							{
								"replace": "projects/client/src/environments/environment.ts",
								"with": "projects/client/src/environments/environment.prod.ts"
							},
							{
								"replace": "projects/client/src/config.json",
								"with": "projects/client/src/config.ks.prod.json"
							}
						],
						"optimization": true,
						"outputHashing": "all",
						"sourceMap": false,
						"extractCss": true,
						"namedChunks": false,
						"aot": true,
						"extractLicenses": true,
						"vendorChunk": false,
						"buildOptimizer": true,
						"outputPath": "C:/Users/Ksoshin/Desktop/Publish/SherpWeb/portal-client"
					},
					"ru": {
						"outputPath": "dist/client-ru/",
						"i18nFile": "projects/client/src/locale/messages.ru.xlf",
						"i18nFormat": "xlf",
						"i18nLocale": "ru",
						"i18nMissingTranslation": "error"
					}
				}
			},
			"serve": {
				"builder": "@angular-devkit/build-angular:dev-server",
				"options": {
					"browserTarget": "client:build",
					"sourceMap": {
						"scripts": true,
						"styles": true,
						"vendor": true
					}
				},
				"configurations": {
					"production": {
						"browserTarget": "client:build:production"
					},
					"ru": {
						"browserTarget": "client:build:ru"
					}
				}
			},
		}
	},

my package.json

{
  "name": "portal-core-app",
  "version": "0.22.2",
  "scripts": {
    "ng": "ng",
    "start": "node --max-old-space-size=4096 ./node_modules/@angular/cli/bin/ng serve",
    ...
    "postinstall": "ngcc"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^10.0.0",
    "@angular/cdk": "^10.0.0",
    "@angular/common": "~10.0.0",
    "@angular/compiler": "~10.0.0",
    "@angular/core": "~10.0.0",
    "@angular/fire": "^6.0.0-rc.1",
    "@angular/flex-layout": "^9.0.0-beta.29",
    "@angular/forms": "^10.0.0",
    "@angular/http": "^7.2.16",
    "@angular/localize": "^10.0.0",
    "@angular/material": "^10.0.0",
    "@angular/platform-browser": "~10.0.0",
    "@angular/platform-browser-dynamic": "~10.0.0",
    "@angular/pwa": "^0.900.4",
    "@angular/router": "~10.0.0",
    "@angular/service-worker": "^10.0.0",
    ...
    "devexpress-dashboard": "^19.2.6",
    "devexpress-reporting-angular": "^19.2.6",
    "devexpress-richedit": "^20.1.3",
    "devextreme": "^19.2.8",
    "devextreme-angular": "^19.2.8",
    "devextreme-cldr-data": "^1.0.2",
    ...
    "ngx-mask": "^8.2.0",
  },
  "devDependencies": {
    "@angular-devkit/architect": "^0.900.0-0 || ^0.900.0",
    "@angular-devkit/build-angular": "^0.1000.0",
    "@angular-devkit/build-ng-packagr": "^0.1000.0",
    "@angular/cli": "~10.0.0",
    "@angular/compiler-cli": "^10.0.0",
    "@angular/language-service": "~10.0.0",
    ...
    "typescript": "^3.9.5"
  }
}

WARNING in C:/Users/AEzhov/source/repos/Portal.Core/Portal.Core.Client/node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.js Module Warning (from C:/Users/AEzhov/source/repos/Portal.Core/Portal.Core.Client/node_modules/source-map-loader/dist/cjs.js): Failed to parse source map: "ng:/ngx-extended-pdf-viewer/lib/toolbar/pdf-toolbar/pdf-toolbar.component.ts" URL is not supported

WARNING in C:/Users/AEzhov/source/repos/Portal.Core/Portal.Core.Client/node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.js Module Warning (from C:/Users/AEzhov/source/repos/Portal.Core/Portal.Core.Client/node_modules/source-map-loader/dist/cjs.js): Failed to parse source map: "ng:/ngx-extended-pdf-viewer/lib/toolbar/pdf-zoom-toolbar/pdf-zoom-dropdown/pdf-zoom-dropdown.component.ts" URL is not supported

WARNING in C:/Users/AEzhov/source/repos/Portal.Core/Portal.Core.Client/node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.js Module Warning (from C:/Users/AEzhov/source/repos/Portal.Core/Portal.Core.Client/node_modules/source-map-loader/dist/cjs.js): Failed to parse source map: "ng:/ngx-extended-pdf-viewer/lib/toolbar/pdf-zoom-toolbar/pdf-zoom-in/pdf-zoom-in.component.ts" URL is not supported

WARNING in C:/Users/AEzhov/source/repos/Portal.Core/Portal.Core.Client/node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.js Module Warning (from C:/Users/AEzhov/source/repos/Portal.Core/Portal.Core.Client/node_modules/source-map-loader/dist/cjs.js): Failed to parse source map: "ng:/ngx-extended-pdf-viewer/lib/toolbar/pdf-zoom-toolbar/pdf-zoom-out/pdf-zoom-out.component.ts" URL is not supported

I dont know what information i can show more.

alekcey0211 avatar Jun 25 '20 13:06 alekcey0211

This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

alan-agius4 avatar Jun 25 '20 13:06 alan-agius4

i can repeate my bug on clean project. Check git repo https://github.com/alekcey0211/repro-angular-bug-source-map

alekcey0211 avatar Jun 25 '20 15:06 alekcey0211

Hi @alekcey0211, thanks for the reproduction.

This seems to be caused by a fix in one of our dependencies https://github.com/webpack-contrib/source-map-loader/commit/b64f7d82de27769c8bbd2be280faf4f9f97492d5 were custom protocols are no longer supported.

The library author will need to update ng-packagr which also removed custom protocols https://github.com/ng-packagr/ng-packagr/commit/481dd8f77c927b564e3d3eb8c79e6cecdc580b52 and cut a new release.

alan-agius4 avatar Jun 26 '20 07:06 alan-agius4

Hi, @alan-agius4. Can i solve this problem without wait for update lib by author?

alekcey0211 avatar Jun 26 '20 07:06 alekcey0211

To suppress the warning you’ll need to disable vendor sourcemaps.

alan-agius4 avatar Jun 26 '20 10:06 alan-agius4

This 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.