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

Avoid creating component with unicode naming, instead of throwing error after finishing creation. #20263

Closed
nobodxbodon opened this Issue Nov 8, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@nobodxbodon

nobodxbodon commented Nov 8, 2017

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[-] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Using unicode naming when creating component succeeds:

$ ng generate component 英雄
  create src/app/英雄/英雄.component.css (0 bytes)
  create src/app/英雄/英雄.component.html (25 bytes)
  create src/app/英雄/英雄.component.spec.ts (628 bytes)
  create src/app/英雄/英雄.component.ts (310 bytes)
  update src/app/app.module.ts (398 bytes)

But it results in error:

英雄.component.ts:7 Uncaught ReferenceError: ViewEncapsulation is not defined
    at eval (英雄.component.ts:7)
    at eval (英雄.component.ts:18)
    at Object.../../../../../src/app/英雄/英雄.component.ts (main.bundle.js:58)
    at __webpack_require__ (inline.bundle.js:55)
    at eval (app.module.ts:5)
    at Object.../../../../../src/app/app.module.ts (main.bundle.js:36)
    at __webpack_require__ (inline.bundle.js:55)
    at eval (main.ts:4)
    at Object.../../../../../src/main.ts (main.bundle.js:74)
    at __webpack_require__ (inline.bundle.js:55)

Expected behavior

Error out when creating component in such way, similar as creating a project with unicode naming:

$ ng new 英雄榜
Project name "英雄榜" is not valid. New project names must start with a letter, and must contain only alphanumeric characters or dashes. When adding a dash the segment after the dash must also start with a letter.
英雄榜
^

Minimal reproduction of the problem with instructions

Described as above.

What is the motivation / use case for changing the behavior?

Keep the feedback in a consistent manner.

Environment


Angular version: X.Y.Z


Browser:
- [-] Chrome (desktop) Version 60.0.3112.113 (Official Build) (64-bit)
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 8.7.0  
- Platform:  Mac

Others:

@trotyl

This comment has been minimized.

Show comment
Hide comment
@trotyl

trotyl Nov 8, 2017

Contributor

It's not an Angular issue, please reopen it in Angular CLI.

Contributor

trotyl commented Nov 8, 2017

It's not an Angular issue, please reopen it in Angular CLI.

@nobodxbodon

This comment has been minimized.

Show comment
Hide comment
@nobodxbodon

nobodxbodon commented Nov 8, 2017

Thanks. angular/angular-cli#8397 created.

@nobodxbodon nobodxbodon closed this Nov 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment