Skip to content

Generators putting a backward slash in import path on Windows #2181

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

Closed
jschwarty opened this issue Sep 16, 2016 · 3 comments
Closed

Generators putting a backward slash in import path on Windows #2181

jschwarty opened this issue Sep 16, 2016 · 3 comments

Comments

@jschwarty
Copy link
Contributor

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Windows 10
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    angular-cli: 1.0.0-beta.14
    node: 6.3.1
    os: win32 x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    Have a dir in the <project>/src/app named profile.
    With the current directory as the top level dir of the project, in the command/terminal run
    ng g c profile/profile-tray
    to generate a new component named ProfileTrayComponent within a dir named profile.
    Look in the app.module.ts file and see the resulting import statement of
    import { ProfileTrayComponent } from './profile\profile-tray/profile-tray.component';
  4. The log given by the failure. Normally this include a stack trace and some
    more information.
  5. Mention any other details that might be useful.

Thanks! We'll be in touch soon.

@jschwarty jschwarty changed the title Generators putting a forward slash in import path on Windows Generators putting a backward slash in import path on Windows Sep 16, 2016
@celliott181
Copy link
Contributor

Just reproduced this.
Windows 10 x64
Angular-CLI 1.0.0-beta.14
Node 6.3.0
NPM 3.10.6

As for the cause, I think we can pinpoint the generate command as the source. It will work fine if you enter ng g c profile\profile-tray (Note the forward slash), but entering ng g c profile/profile-tray will cause it to use the Unix style path instead of replacing the slash with a forward slash. This happens for any slashes contained in the path/sub/name string.

@filipesilva
Copy link
Contributor

Fixed in #1719

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants