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

Upgrading to Angular 14 causes Unknown arguments: inlineStyle, inlineTemplate #1302

Closed
ianvink opened this issue Jul 3, 2022 · 13 comments · Fixed by #1304
Closed

Upgrading to Angular 14 causes Unknown arguments: inlineStyle, inlineTemplate #1302

ianvink opened this issue Jul 3, 2022 · 13 comments · Fixed by #1304
Assignees
Labels
type: bug Something isn't working

Comments

@ianvink
Copy link

ianvink commented Jul 3, 2022

Current Behavior

When using the Generate Component option with inline style and template checkboxes checked the CLI errors out:

 Unknown arguments: inlineStyle, inlineTemplate

Environment

	"@angular-devkit/build-angular": "^14.0.4",
	"@angular-eslint/builder": "^14.0.0",
	"@angular-eslint/eslint-plugin": "^14.0.0",
	"@angular-eslint/eslint-plugin-template": "^14.0.0",
	"@angular-eslint/schematics": "^14.0.0",
	"@angular-eslint/template-parser": "^14.0.0",
	"@angular/cli": "^14.0.4",
	"@angular/compiler-cli": "^14.0.4",
@ianvink ianvink added the type: bug Something isn't working label Jul 3, 2022
@Cammisuli
Copy link
Member

If you restart vscode, is the error still reproducible?

There's some caching done when initially loading the workspace and if the upgrade happened while vscode was still opened, then we probably still have the old schema loaded.

@ianvink
Copy link
Author

ianvink commented Jul 4, 2022

yes, what folders do i delete to clear the cache?

@Cammisuli
Copy link
Member

There's no folders, it's in memory cache. That's why restarting clears it.

If it didn't work after restarting vscode, I'll take a look today to see if I can reproduce it.

@Cammisuli
Copy link
Member

I can't seem to reproduce it...
image

Delete your node_modules, reinstall the deps and try again

@ianvink
Copy link
Author

ianvink commented Jul 4, 2022

On Windows 11 I can reproduce it. I uninstalled the wonderful nx-console, removed node_modules, rebooted, then reinstalled everything and it's unfortunately still using the old --inlineTemplate
image

@ianvink
Copy link
Author

ianvink commented Jul 4, 2022

image

@ianvink
Copy link
Author

ianvink commented Jul 4, 2022

I believe the new CLI command is --inline-template instead of --inlineTemplate

Thank you for all your helpful work on this amazing project. Much appreciated.

@Cammisuli
Copy link
Member

Weird.. I'm not sure where your inline-template is coming from. From the angular source, it shows as inlineTemplate and inlineStyles
https://github.com/angular/angular-cli/blob/87c7f4cbc89cb27cd975aadac442440a6fe61f84/packages/schematics/angular/component/schema.json#L40-L52

Do you happen to have angular cli installed globally? And if it is, is it the same version as your local workspace one?

@ianvink
Copy link
Author

ianvink commented Jul 4, 2022

Projects based on Angular 13 work, but give this warning:

Support for camel case arguments has been deprecated and will be removed in a future major version.
Use '--inline-style' instead of '--inlineStyle'.

When I update them to 14 via ng update, then --inlineStyle eg no longer work

@Cammisuli
Copy link
Member

Can you provide a reproduction in a repo I can clone?

Nx Console reads the schema.json files in the node_modules folder. If you look into node_modules/@schematics/angular/component/schema.json does it show inlineTemplate or inline-template?

@ianvink
Copy link
Author

ianvink commented Jul 4, 2022

Very strange. It shows:

"inlineTemplate": {
  "description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.",
  "type": "boolean",
  "default": false,
  "alias": "t",
  "x-user-analytics": 10
},

But the CLI's Generate command says that is deprecated now in 14.

Support for camel case arguments has been deprecated and will be removed in a future major version.
Use '--inline-style' instead of '--inlineStyle'.

@Cammisuli
Copy link
Member

That's where we get the information from.. 🤔

Is your angular cli installed globally?

@ianvink
Copy link
Author

ianvink commented Jul 4, 2022

Yes, 14.0.4 everywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants