Scully: Error when running ng build

Created on 9 Mar 2020  路  8Comments  路  Source: scullyio/scully

馃悶 Bug report

Description

I get the following output when running ng build:

$ ng build --prod

ERROR in node_modules/@types/jsdom/index.d.ts:12:10 - error TS2305: Module '"../../parse5/lib"' has no exported member 'ElementLocation'.

12 import { ElementLocation } from 'parse5';

馃敩 Minimal Reproduction

Run ng build

馃捇Your Environment

Angular Version:




Angular CLI: 9.0.5
Node: 10.16.3
OS: darwin x64

Angular: 9.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.5
@angular-devkit/build-angular     0.900.5
@angular-devkit/build-optimizer   0.900.5
@angular-devkit/build-webpack     0.900.5
@angular-devkit/core              9.0.5
@angular-devkit/schematics        9.0.5
@angular/cdk                      9.1.1
@angular/fire                     5.4.2
@angular/material                 9.1.1
@ngtools/webpack                  9.0.5
@schematics/angular               9.0.5
@schematics/update                0.900.5
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

Scully Version:




{
  "name": "msp-navigator",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --aot",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points",
    "scully": "scully",
    "scully:serve": "scully serve"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^9.0.5",
    "@angular/cdk": "^9.1.1",
    "@angular/common": "^9.0.5",
    "@angular/compiler": "^9.0.5",
    "@angular/core": "^9.0.5",
    "@angular/fire": "^5.4.2",
    "@angular/forms": "^9.0.5",
    "@angular/material": "^9.1.1",
    "@angular/platform-browser": "^9.0.5",
    "@angular/platform-browser-dynamic": "^9.0.5",
    "@angular/router": "^9.0.5",
    "@ckeditor/ckeditor5-angular": "^1.2.2",
    "@ckeditor/ckeditor5-build-classic": "^17.0.0",
    "@fortawesome/angular-fontawesome": "^0.6.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.27",
    "@fortawesome/free-brands-svg-icons": "^5.12.1",
    "@fortawesome/free-regular-svg-icons": "^5.12.1",
    "@fortawesome/free-solid-svg-icons": "^5.12.1",
    "@ncstate/sat-popover": "^4.0.0",
    "@scullyio/init": "0.0.23",
    "@scullyio/ng-lib": "latest",
    "@scullyio/scully": "latest",
    "angular-google-tag-manager": "^1.1.1",
    "core-js": "^3.6.4",
    "country-data-list": "^1.1.9",
    "firebase": "^7.10.0",
    "firebase-tools": "^7.14.0",
    "firebaseui": "^4.4.0",
    "firebaseui-angular": "^4.0.1",
    "ng-click-outside": "^6.0.0",
    "ngx-virtual-scroller": "^4.0.2",
    "ngx-webstorage-service": "^4.1.0",
    "rxjs": "^6.5.4",
    "tslib": "^1.11.1",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.900.5",
    "@angular/cli": "^9.0.5",
    "@angular/compiler-cli": "^9.0.5",
    "@angular/language-service": "^9.0.5",
    "@types/jasmine": "^3.5.8",
    "@types/jasminewd2": "~2.0.8",
    "@types/node": "^13.9.0",
    "@types/segment-analytics": "0.0.32",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.4.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "^2.1.1",
    "karma-jasmine": "^3.1.1",
    "karma-jasmine-html-reporter": "^1.5.2",
    "protractor": "^5.4.3",
    "ts-node": "^8.6.2",
    "tslint": "^6.0.0",
    "typescript": "~3.7.0"
  }
}

馃敟 Exception or Error




ERROR in node_modules/@types/jsdom/index.d.ts:12:10 - error TS2305: Module '"../../parse5/lib"' has no exported member 'ElementLocation'.

12 import { ElementLocation } from 'parse5';
can't reproduce need repo example

Most helpful comment

Got the same issue.

Quick fixed it by updating parse5 package.
try to run npm i -D parse5@latest
I then deleted the parse5 line from my package.json to keep it clean for further corrections.

All 8 comments

@Burgov Do you have en reproduction repo? We can not reproduce. We have it working on Linux, Mac, Windows, ChromeOS and GitHub actions.
Parse5 seems to be a dependency of the Angular CLI, we are not using it anywhere inside Scully.
I'm willing to investigate deeper, but I do need a way to reproduce the error.

@SanderElias I've sent you a message on LinkedIn regarding this

@Burgov I had the same issue and in order to solve it I removed the node_modules folder and npm install agin. I am using node 12.16.1, but it should also weork with v10.16.3

@GuzmanPI thanks for the suggestion but unfortunately that's not working for me.

@Burgov there maybe an underlying issue with "@types/jsdom" https://github.com/DefinitelyTyped/DefinitelyTyped/issues/26338?

You may want to try and do a npm i @types/jsdom@@16.1.0 does that work out of curiosity?

Got the same issue.

Quick fixed it by updating parse5 package.
try to run npm i -D parse5@latest
I then deleted the parse5 line from my package.json to keep it clean for further corrections.

@Silvac34 that did the trick, thanks!

@Burgov Thanks for the confirmation.
To summarize, This bug is caused by an outdated 3rth party npm module `parse5, and solved by updating that module to its latest version by running:

npm i -D parse5@latest

I'm going to close this issue as Scully can not do anything to prevent NPM package clashes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Splaktar picture Splaktar  路  6Comments

Gyrosh picture Gyrosh  路  5Comments

valonymeri picture valonymeri  路  5Comments

beeman picture beeman  路  3Comments

nishimura-yuji picture nishimura-yuji  路  4Comments