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

Angular 12 Schematics throws error about required properties #20594

Closed
1 task done
mraible opened this issue Apr 21, 2021 · 2 comments · Fixed by #20598
Closed
1 task done

Angular 12 Schematics throws error about required properties #20594

mraible opened this issue Apr 21, 2021 · 2 comments · Fixed by #20598
Labels
area: @angular-devkit/core freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Milestone

Comments

@mraible
Copy link
Contributor

mraible commented Apr 21, 2021

🐞 Bug report

Command (mark with an x)

  • add

Is this a regression?

Yes.

Description

I created OktaDev Schematics as a way to add authentication with Okta to new apps that are created with a framework's respective CLI (e.g., Angular CLI, Create React App, Vue CLI, etc.).

Today, I discovered it doesn't work with Angular CLI ~12.0.0-next.9.

$ ng add @oktadev/schematics
ℹ Using package manager: npm
✔ Found compatible package version: @oktadev/schematics@3.5.0.
✔ Package information loaded.

The package @oktadev/schematics@3.5.0 will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
? What is your OIDC app's issuer URL? https://dev-9323263.okta.com/oauth2/default
? What is your OIDC app's client ID? 0oambt69c4LNBiJ7u5d6
Schematic input does not validate against the Schema: {"project":"foo","clientId":"0oambt69c4LNBiJ7u5d6"}
Errors:

  Data path "" must have required property 'issuer'

🔬 Minimal Reproduction

Steps to reproduce:

npm i -g @angular/cli@next
ng new foo --routing --style css
ng add @oktadev/schematics

If I install Angular CLI v11.2.10, it works fine.

$ ng add @oktadev/schematics
ℹ Using package manager: npm
✔ Found compatible package version: @oktadev/schematics@3.5.0.
✔ Package information loaded.
✔ Package successfully installed.
? What is your OIDC app's issuer URL? https://dev-9323263.okta.com/oauth2/default
? What is your OIDC app's client ID? 0oambt69c4LNBiJ7u5d6
            ✅️ Added '@okta/okta-angular' into dependencies
            🔍 Installing packages...
CREATE src/app/auth-routing.module.ts (1231 bytes)
CREATE src/app/home/home.component.html (186 bytes)
CREATE src/app/home/home.component.spec.ts (1027 bytes)
CREATE src/app/home/home.component.ts (638 bytes)
CREATE src/app/home/home.component.css (0 bytes)
CREATE src/app/shared/okta/auth.interceptor.ts (1019 bytes)
UPDATE src/app/app.module.ts (475 bytes)
UPDATE package.json (1274 bytes)
UPDATE src/app/app.component.spec.ts (1386 bytes)
UPDATE src/app/app.component.ts (603 bytes)
✔ Packages installed successfully.

🔥 Exception or Error


Schematic input does not validate against the Schema: {"project":"foo","clientId":"0oambt69c4LNBiJ7u5d6"}
Errors:

  Data path "" must have required property 'issuer'

🌍 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 12.0.0-next.9
Node: 14.15.0
OS: darwin x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1200.0-next.9 (cli-only)
@angular-devkit/core         12.0.0-next.9 (cli-only)
@angular-devkit/schematics   12.0.0-next.9 (cli-only)
@schematics/angular          12.0.0-next.9 (cli-only)

Anything else relevant?

/cc @mgechev

@mraible
Copy link
Contributor Author

mraible commented May 3, 2021

I upgraded to v12 RC1 today and tried it with OktaDev Schematics. Now I get past the prompts, but a new error happens.

➜  foo git:(main) ng add @oktadev/schematics
ℹ Using package manager: npm
✔ Found compatible package version: @oktadev/schematics@4.0.0.
✔ Package information loaded.

The package @oktadev/schematics@4.0.0 will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
? What is your OIDC app's issuer URL? foo
? What is your OIDC app's client ID? bar
Cannot find module 'bluebird'
Require stack:
- /Users/mraible/foo/node_modules/@schematics/update/node_modules/pacote/extract.js
- /Users/mraible/foo/node_modules/@schematics/update/node_modules/pacote/index.js
- /Users/mraible/foo/node_modules/@schematics/update/update/npm.js
- /Users/mraible/foo/node_modules/schematics-utilities/dist/package_update/npm.js
- /Users/mraible/foo/node_modules/schematics-utilities/dist/package_update/index.js
- /Users/mraible/foo/node_modules/schematics-utilities/dist/index.js
- /Users/mraible/foo/node_modules/@oktadev/schematics/src/add-auth/index.js
- /Users/mraible/foo/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /Users/mraible/foo/node_modules/@angular-devkit/schematics/tools/index.js
- /Users/mraible/foo/node_modules/@angular/cli/utilities/json-schema.js
- /Users/mraible/foo/node_modules/@angular/cli/models/command-runner.js
- /Users/mraible/foo/node_modules/@angular/cli/lib/cli/index.js
- /usr/local/lib/node_modules/@angular/cli/lib/init.js
- /usr/local/lib/node_modules/@angular/cli/bin/ng

It doesn't happen if I use Angular CLI v11.2.11.

➜  bar git:(main) ng add @oktadev/schematics
ℹ Using package manager: npm
✔ Found compatible package version: @oktadev/schematics@4.0.0.
✔ Package information loaded.
✔ Package successfully installed.
? What is your OIDC app's issuer URL? foo
? What is your OIDC app's client ID? bar
            ✅️ Added '@okta/okta-angular' into dependencies
            🔍 Installing packages...
CREATE src/app/auth-routing.module.ts (1174 bytes)
CREATE src/app/home/home.component.html (186 bytes)
CREATE src/app/home/home.component.spec.ts (1027 bytes)
CREATE src/app/home/home.component.ts (638 bytes)
CREATE src/app/home/home.component.css (0 bytes)
CREATE src/app/shared/okta/auth.interceptor.ts (1019 bytes)
UPDATE src/app/app.module.ts (475 bytes)
UPDATE package.json (1276 bytes)
UPDATE src/app/app.component.spec.ts (1386 bytes)
UPDATE src/app/app.component.ts (603 bytes)
✔ Packages installed successfully.
Execution time: 19 s.

My environment:

Angular CLI: 12.0.0-rc.1
Node: 14.16.1
Package Manager: npm 7.11.1
OS: darwin x64

Angular: 12.0.0-rc.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

@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 Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular-devkit/core freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants