Skip to content

beta.4/5 cannot resolve client classes (nor window) in environment.dev.ts #833

Closed
@sgbeal

Description

@sgbeal

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Windows 10 (running in admin mode)

  1. Versions. Please run ng --version. If there's nothing outputted, please
  2. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

we import client-side classes in environment.dev.ts. In angular-cli versions newer than 1.0.0-beta.1, those imports cannot be resolved at build-time. It also cannot resolve 'window', so it's not a problem with our classes.

Log

with 1.0.0-beta.1:

    $ ng build
    (node:9540) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
    Built project successfully. Stored in "dist/".

    stephan@Curie MINGW64 /d/src/.../nms-gui (my-branch)
    $ ng --version
    (node:6200) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
    angular-cli: 1.0.0-beta.1
    node: 6.1.0
    os: win32 x64

with 1.0.0-beta.4: (edit: same result with beta.5)

    stephan@Curie MINGW64 /d/src/.../nms-gui (my-branch)
    $ npm install
    npm WARN deprecated [email protected]: This package has been discontinued in favor of lodash@^4.0.0.
    npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead!
    npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

    > [email protected] postinstall D:\src\...\nms-gui
    > typings install


    ├── es6-shim (ambient)
    ├── angular-protractor (ambient dev)
    ├── jasmine (ambient dev)
    └── selenium-webdriver (ambient dev)

    [email protected] D:\src\...\nms-gui
    `-- [email protected]
      `-- [email protected]
        +-- [email protected]
        | +-- [email protected]
        | | +-- [email protected]
        | | `-- [email protected]
        | +-- [email protected]
        | `-- [email protected]
        `-- [email protected]
          +-- [email protected]
          +-- [email protected]
          `-- [email protected]
            `-- [email protected]

    npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
    npm WARN notsup Not compatible with your operating system or architecture: [email protected]
    npm WARN optional Skipping failed optional dependency /browser-sync/chokidar/fsevents:
    npm WARN notsup Not compatible with your operating system or architecture: [email protected]

    stephan@Curie MINGW64 /d/src/.../nms-gui (my-branch)
    $ ng --version
    (node:8100) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
    angular-cli: 1.0.0-beta.4
    node: 6.1.0
    os: win32 x64

    stephan@Curie MINGW64 /d/src/.../nms-gui (my-branch)
    $ ng build
    (node:10520) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
    Cannot find module './services/core/logger'
    Error: Cannot find module './services/core/logger'
        at Function.Module._resolveFilename (module.js:438:15)
        at Function.Module._load (module.js:386:25)
        at Module.require (module.js:466:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (D:\src\...\nms-gui\config\environment.dev.ts:5:16)
        at Module._compile (module.js:541:32)

it's complaining about the first import it finds. It also cannot resolve 'window' or 'console'.

  1. The log given by the failure. Normally this include a stack trace and some
    more information.

see above.

  1. Mention any other details that might be useful.

Works fine with 1.0.0-beta.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenteffort2: medium (days)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions