Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating new component shows error:TypeError: core_1.PriorityQueue is not a constructor #9374

Closed
praveenojha33 opened this issue Jan 25, 2018 · 16 comments
Labels
needs: more info Reporter must clarify the issue

Comments

@praveenojha33
Copy link

Versions

Angular CLI: 1.6.4
Node: 8.9.4
OS: linux x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.4
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.4
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

Repro steps

  • Running command ng g c component

Observed behavior

core_1.PriorityQueue is not a constructor
TypeError: core_1.PriorityQueue is not a constructor
    at new TaskScheduler (/home/praveen/academeics/node_modules/@angular-devkit/schematics/src/engine/task.js:20:23)
    at SchematicEngine.createContext (/home/praveen/academeics/node_modules/@angular-devkit/schematics/src/engine/engine.js:81:31)
    at SchematicImpl.call (/home/praveen/academeics/node_modules/@angular-devkit/schematics/src/engine/schematic.js:35:38)
    at Promise (/home/praveen/academeics/node_modules/@angular/cli/tasks/schematic-run.js:73:23)
    at new Promise (<anonymous>)
    at Class.run (/home/praveen/academeics/node_modules/@angular/cli/tasks/schematic-run.js:72:16)
    at Class.run (/home/praveen/academeics/node_modules/@angular/cli/commands/generate.js:161:33)
    at resolve (/home/praveen/academeics/node_modules/@angular/cli/ember-cli/lib/models/command.js:261:20)
    at new Promise (<anonymous>)
    at Class.validateAndRun (/home/praveen/academeics/node_modules/@angular/cli/ember-cli/lib/models/command.js:240:12)

Desired behavior

Component should be created

###Deleting node_modules allowed creation of component and installing it again produces the above bug.
error

@nilseckert
Copy link

I had the same issue and solved it by adding devkit-core in version 0.0.29 to my devDependencies

"devDependencies": {
    "@angular-devkit/core": "0.0.29",
   ...
}

or using with npm i -D @angular-devkit/core@0.0.29

@BreadBomb
Copy link

This works for me:

I downgraded my globally installed angular cli to 1.5.0.

Just

npm remove -g @angular/cli
npm install -g @angular/cli@1.5.0

I think this only works if your project is running on Angular 4

@Oakerin
Copy link

Oakerin commented Jan 25, 2018

The same issue.

"devDependencies": { "@angular/cli": "1.6.3" }

@buchmiller
Copy link

I was able to resolve this same error by updating angular-cli to the latest version

npm remove -g @angular/cli
npm install -g @angular/cli@latest

and ensuring that the @angular/cli version in my package.json is fairly recent too.
Then I completely removed the node_modules folder and did a fresh install.

@Brocco
Copy link
Contributor

Brocco commented Jan 25, 2018

Can someone provide a reproduction repository? I have not been able to reproduce this issue. Also, please update to the latest version fo the CLI which is currently 1.6.6 which has a fix for some of the generate issues which were reported.

@Brocco Brocco added the needs: more info Reporter must clarify the issue label Jan 25, 2018
@tigredonorte
Copy link

Same here

@gautamkrishnar
Copy link

Same here... Fixed it by adding "@angular-devkit/core": "0.0.29" to package.json for angular 5 using npm i -D @angular-devkit/core@0.0.29 command

@olakara
Copy link

olakara commented Jan 28, 2018

@gautamkrishnar & @nickroberts Thanks! I was able to get around the issue by following your solution.

@Oakerin
Copy link

Oakerin commented Jan 30, 2018

@gautamkrishnar Really thanks! It works!

@filipesilva
Copy link
Contributor

@gautamkrishnar and @buchmiller's comments seem to indicate this is fixed by updating. I think it's the same root cause as #9194, which is fixed in 1.6.6 as detailed in #9194 (comment).

@omganesh
Copy link

omganesh commented Feb 8, 2018

thanks it works
updated the package.json followed by npm install

@sudheerkosanam
Copy link

sudheerkosanam commented Feb 19, 2018

npm i -D @angular-devkit /core@0.0.29
it works
update the package

@fahedalh
Copy link

fahedalh commented Mar 16, 2018

install this 👍
$ npm i -D @angular-devkit/core@0.0.29

it will solve the problem

@hardy12994
Copy link

@nilseckert +1 npm i -D @angular-devkit/core work for me !!

@pugillum
Copy link

In my case, I solved using: npm install @angular-devkit/core@0.3.2 --save-dev. I am using angular CLI 1.7.4

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: more info Reporter must clarify the issue
Projects
None yet
Development

No branches or pull requests