You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.
"ng generate component" in a sub directory adds a backslash in the app.module.ts import statement.
For example, app/settings component exists, after "ng generate component users" in the settings directory, the app.module has this statement:
"import { UsersComponent } from './settings\users/users.component';"
ng serve crashes, after changing the backslash to a normal slash, ng serve builds everything and the app works like expected!
The log given by the failure. Normally this include a stack trace and some
more information.
Bad character escape sequence (24:44)
You may need an appropriate loader to handle this file type.
| import { DashboardComponent } from './dashboard/dashboard.component';
| import { SettingsComponent } from './settings/settings.component';
| import { UsersComponent } from './settings\users/users.component';
| export var AppModule = (function () {
| function AppModule() {
@ ./src/app/index.ts 2:0-29
@ ./src/main.ts
@ multi main
The text was updated successfully, but these errors were encountered:
Seems like part of a known issue. See #2132 and #2357.
This has to do with the OS level directory separators, and the workaround is to generate components from the root using the proper slash to match your OS.
Windows 7
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:angular-cli: 1.0.0-beta.15
node: 6.3.0
os: win32 x64
do on your code? etc.
"ng generate component" in a sub directory adds a backslash in the app.module.ts import statement.
For example, app/settings component exists, after "ng generate component users" in the settings directory, the app.module has this statement:
"import { UsersComponent } from './settings\users/users.component';"
ng serve crashes, after changing the backslash to a normal slash, ng serve builds everything and the app works like expected!
more information.
Bad character escape sequence (24:44)
You may need an appropriate loader to handle this file type.
| import { DashboardComponent } from './dashboard/dashboard.component';
| import { SettingsComponent } from './settings/settings.component';
| import { UsersComponent } from './settings\users/users.component';
| export var AppModule = (function () {
| function AppModule() {
@ ./src/app/index.ts 2:0-29
@ ./src/main.ts
@ multi main
The text was updated successfully, but these errors were encountered: