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. #8397

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

Comments

Projects
None yet
4 participants
@nobodxbodon

nobodxbodon commented Nov 8, 2017

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Angular CLI: 1.5.0
Node: 8.7.0
OS: darwin x64

Repro steps.

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.

The log given by the failure.

As @clydin kindly pointed out below, error below is the same as #8386, thus most likely not related with the unicode naming.

英雄.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)

Desired functionality.

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.
英雄榜
^

Mention any other details that might be useful.

@adityaparab

This comment has been minimized.

Show comment
Hide comment
@adityaparab

adityaparab Nov 8, 2017

Contributor

If this is not being worked on by anyone, I'd like to work on this.

Contributor

adityaparab commented Nov 8, 2017

If this is not being worked on by anyone, I'd like to work on this.

@clydin

This comment has been minimized.

Show comment
Hide comment
@clydin

clydin Nov 8, 2017

Member

The error shown above is a known issue (#8386) and is not related to unicode filenames.

Member

clydin commented Nov 8, 2017

The error shown above is a known issue (#8386) and is not related to unicode filenames.

@nobodxbodon

This comment has been minimized.

Show comment
Hide comment
@nobodxbodon

nobodxbodon Nov 8, 2017

Thanks for the heads up, and It does result in the same error. But as far as I know, Angular doesn't support unicode naming in component. If that's the case, the issue still holds, I suppose?

nobodxbodon commented Nov 8, 2017

Thanks for the heads up, and It does result in the same error. But as far as I know, Angular doesn't support unicode naming in component. If that's the case, the issue still holds, I suppose?

@Brocco

This comment has been minimized.

Show comment
Hide comment
@Brocco

Brocco Nov 14, 2017

Contributor

This issue has been reported several times and is currently being tracked via #8398 closing this issue.
Duplicate of #8398

Contributor

Brocco commented Nov 14, 2017

This issue has been reported several times and is currently being tracked via #8398 closing this issue.
Duplicate of #8398

@Brocco Brocco closed this Nov 14, 2017

@nobodxbodon

This comment has been minimized.

Show comment
Hide comment
@nobodxbodon

nobodxbodon Nov 14, 2017

@Brocco like I mentioned above, the error was a side effect of the issue, but the focus of this issue is to avoid creating component with unicde naming through cli tool. In other words, for current implementation, ng generate component foo is legit, but ng generate component 英雄 should not be considered as legit, as component with unicode naming isn't supported. So IMO the issue isn't duplicate.

nobodxbodon commented Nov 14, 2017

@Brocco like I mentioned above, the error was a side effect of the issue, but the focus of this issue is to avoid creating component with unicde naming through cli tool. In other words, for current implementation, ng generate component foo is legit, but ng generate component 英雄 should not be considered as legit, as component with unicode naming isn't supported. So IMO the issue isn't duplicate.

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