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

ng add @angular/elements@next fails with schema.json not found error #35154

Closed
hisham opened this issue Feb 4, 2020 · 8 comments
Closed

ng add @angular/elements@next fails with schema.json not found error #35154

hisham opened this issue Feb 4, 2020 · 8 comments
Assignees
Labels
area: elements Issues related to Angular Elements freq1: low regression Indicates than the issue relates to something that worked in a previous version type: bug/fix
Milestone

Comments

@hisham
Copy link

hisham commented Feb 4, 2020

🐞 bug report

Affected Package

The issue is caused by package @angular/elements

Is this a regression?

Yes. Doing ng add @angular/elements works fine.

Description

Creating a new workspace project using angular 9 RC 12. Everything installing fine, but when doing ng add @angular/elements@next I get:

`An unhandled exception occurred: Path "<my_dir>/node_modules/@angular/elements/schematics/ng-add/schema.json" does not exist.
See "/private/var/folders/9c/scyzyh01349gnx6qgkp_twzh0000gn/T/ng-GPnlhg/angular-errors.log" for further details.

Log shows:

[error] Error: Path "/Users/hisham/src/ess-app/frontend/node_modules/@angular/elements/schematics/ng-add/schema.json" does not exist.
    at readFile (/Users/hisham/src/ess-app/frontend/node_modules/@angular-devkit/schematics/tools/file-system-utility.js:17:15)
    at Object.readJsonFile (/Users/hisham/src/ess-app/frontend/node_modules/@angular-devkit/schematics/tools/file-system-utility.js:45:29)
    at NodeModulesEngineHost.createSchematicDescription (/Users/hisham/src/ess-app/frontend/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:183:48)
    at SchematicEngine.createSchematic (/Users/hisham/src/ess-app/frontend/node_modules/@angular-devkit/schematics/src/engine/engine.js:219:38)
    at CollectionImpl.createSchematic (/Users/hisham/src/ess-app/frontend/node_modules/@angular-devkit/schematics/src/engine/engine.js:69:29)
    at AddCommand.getSchematic (/Users/hisham/src/ess-app/frontend/node_modules/@angular/cli/models/schematic-command.js:134:27)
    at AddCommand.runSchematic (/Users/hisham/src/ess-app/frontend/node_modules/@angular/cli/models/schematic-command.js:296:32)
    at AddCommand.executeSchematic (/Users/hisham/src/ess-app/frontend/node_modules/@angular/cli/commands/add-impl.js:176:31)
    at AddCommand.run (/Users/hisham/src/ess-app/frontend/node_modules/@angular/cli/commands/add-impl.js:60:29)
    at async AddCommand.validateAndRun (/Users/hisham/src/ess-app/frontend/node_modules/@angular/cli/models/command.js:134:28)
    at async Object.runCommand (/Users/hisham/src/ess-app/frontend/node_modules/@angular/cli/models/command-runner.js:201:24)
    at async default_1 (/Users/hisham/src/ess-app/frontend/node_modules/@angular/cli/lib/cli/index.js:62:31)

Anything else relevant?

OSX 10.5.12, npm 6.13.2, node 13.2.0

@AndrewKushnir
Copy link
Contributor

Hi @hisham, it looks like the problem is related to Angular CLI, so I'm transferring this issue to Angular CLI repo for further investigation. Thank you.

@AndrewKushnir AndrewKushnir transferred this issue from angular/angular Feb 4, 2020
@clydin
Copy link
Member

clydin commented Feb 5, 2020

The schema.json file appears to be missing from the published package: https://unpkg.com/browse/@angular/elements@9.0.0-rc.14/schematics/ng-add/

Transferring back to the framework as this looks like a packaging issue.

@clydin clydin transferred this issue from angular/angular-cli Feb 5, 2020
@AndrewKushnir AndrewKushnir added the area: elements Issues related to Angular Elements label Feb 5, 2020
@ngbot ngbot bot added this to the needsTriage milestone Feb 5, 2020
@alan-agius4 alan-agius4 self-assigned this Feb 6, 2020
@alan-agius4 alan-agius4 added freq2: medium regression Indicates than the issue relates to something that worked in a previous version type: bug/fix labels Feb 7, 2020
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Feb 7, 2020
@cveld
Copy link

cveld commented Feb 8, 2020

Just a note; schema.json is also not present in earlier versions of @angular/elements; checked a couple of versions at unpkg: 6.x, 7.x, 8.x.

@LayZeeDK
Copy link
Contributor

LayZeeDK commented Feb 9, 2020

This is still a problem with:

  • @angular/cli@9.0.1
  • @angular/core@9.0.0
  • @angular/elements@9.0.0

(on Windows 10)

Steps to reproduce

  1. Execute ng new elements-app.
  2. Enter the elements-app directory.
  3. Execute ng add @angular/elements.

Error message

An unhandled exception occurred: Path "C:\projects\sandbox\ngx-elements-app\node_modules\@angular\elements\schematics\ng-add\schema.json" does not exist.
See "C:\Users\xxx\AppData\Local\Temp\ng-VV0CPj\angular-errors.log" for further details.

Content of angular-errors.log

[error] Error: Path "C:\projects\sandbox\ngx-elements-app\node_modules\@angular\elements\schematics\ng-add\schema.json" does not exist.
    at readFile (C:\projects\sandbox\ngx-elements-app\node_modules\@angular-devkit\schematics\tools\file-system-utility.js:17:15)
    at Object.readJsonFile (C:\projects\sandbox\ngx-elements-app\node_modules\@angular-devkit\schematics\tools\file-system-utility.js:45:29)
    at NodeModulesEngineHost.createSchematicDescription (C:\projects\sandbox\ngx-elements-app\node_modules\@angular-devkit\schematics\tools\file-system-engine-host-base.js:183:48)
    at SchematicEngine.createSchematic (C:\projects\sandbox\ngx-elements-app\node_modules\@angular-devkit\schematics\src\engine\engine.js:219:38)
    at CollectionImpl.createSchematic (C:\projects\sandbox\ngx-elements-app\node_modules\@angular-devkit\schematics\src\engine\engine.js:69:29)
    at AddCommand.getSchematic (C:\projects\sandbox\ngx-elements-app\node_modules\@angular\cli\models\schematic-command.js:134:27)
    at AddCommand.runSchematic (C:\projects\sandbox\ngx-elements-app\node_modules\@angular\cli\models\schematic-command.js:296:32)
    at AddCommand.executeSchematic (C:\projects\sandbox\ngx-elements-app\node_modules\@angular\cli\commands\add-impl.js:176:31)
    at AddCommand.run (C:\projects\sandbox\ngx-elements-app\node_modules\@angular\cli\commands\add-impl.js:142:21)
    at async AddCommand.validateAndRun (C:\projects\sandbox\ngx-elements-app\node_modules\@angular\cli\models\command.js:134:28)
    at async Object.runCommand (C:\projects\sandbox\ngx-elements-app\node_modules\@angular\cli\models\command-runner.js:201:24)
    at async default_1 (C:\projects\sandbox\ngx-elements-app\node_modules\@angular\cli\lib\cli\index.js:62:31)

Files in schematics folder

In node_modules/@angular/elements/schematics/ng-add I have schema.js, not schema.json.

These files are present:

  • index.d.ts
  • index.js
  • schema.d.ts
  • schema.js

@alexander-patton
Copy link

Seeing this same issue following these steps on macOS 10.13

@aressler38
Copy link

When will the fix be published to the public npm registry?

@LayZeeDK
Copy link
Contributor

Probably in 9.0.1. Patch releases are usually weekly.

@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 Mar 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: elements Issues related to Angular Elements freq1: low regression Indicates than the issue relates to something that worked in a previous version type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants