Skip to content

Absolute Path Imports not working #1734

Closed
@iamyojimbo

Description

@iamyojimbo

OS?

OSX v 10.11.4

Versions

angular-cli: 1.0.0-beta.11-webpack.2
node: 6.2.2
os: darwin x64

Repro steps.

import thing from 'src/app/path/to/thing';

  • Both my linter and ng build tell me that the module isn't found. What am I doing wrong? I have tried all different combinations of this. What is the correct method?
  • Do I need to change any settings in angular-cli config files?

The log given by the failure

ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve 'src/app/shared/services' in '/Users/savvas/code/tl/src/app'
 @ ./src/app/app.module.ts 18:0-54
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main

ERROR in [default] /Users/savvas/code/tl/src/app/app.module.ts:11:28 
Cannot find module 'src/app/shared/services'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions