-
Notifications
You must be signed in to change notification settings - Fork 12k
The CLI adds the imports and declarations 3 characters too early #9712
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
Comments
I can confirm this also happens without any alternate non utf text:
result in app.module.ts:
...
Happens on OSX with two different MPS
|
I got used to using the |
Duplicate of #9560 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Angular CLI: 1.7.0
Node: 9.5.0
OS: win32 x64
Angular: 5.2.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
angular/cdk: 5.2.2
angular/cli: 1.7.0
angular/material: 5.2.2
angular-devkit/build-optimizer: 0.3.1
angular-devkit/core: 0.3.1
angular-devkit/schematics: 0.3.1
ngtools/json-schema: 1.2.0
ngtools/webpack: 1.10.0
schematics/angular: 0.3.1
schematics/package-update: 0.3.1
typescript: 2.6.2
webpack: 3.11.0
Repro steps
I am writing an app in a Cyrillic language, and the encoding of the files that the CLI generates don't support the Cyrillic characters (I am getting ��� �� ������ in the browser) so I found this powershell script:
that converts all the files to UTF 8 and that way I can get Cyrillic in the browser. To reproduce the issue simply create a new project, run the script (make sure that the path points to the
app
folder) and then add a new component to the project. Imports in the module would look something like this:and the same happens with the declarations:
I don't know if this is connected to #2077, but never the less, changing the encoding of the module file shouldn't break the functionality of the CLI.
Desired behavior
The module shouldn't have any errors after a component is generated.
Mention any other details that might be useful (optional)
I thought it had something to do with the script, so I used Notepad++ to convert the module file to UTF8 and again I got the same result.
EDIT:
I just noticed that the import is added 3 characters too early, but the declaration only 2.
The text was updated successfully, but these errors were encountered: