Skip to content

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

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 lodash-node@2.4.1: This package has been discontinued in favor of lodash@^4.0.0.
    npm WARN deprecated cross-spawn-async@2.2.4: cross-spawn no longer requires a build toolchain, use it instead!
    npm WARN deprecated graceful-fs@3.0.8: 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.

    > nms-gui@0.0.0-alphalpha postinstall D:\src\...\nms-gui
    > typings install


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

    nms-gui@0.0.0-alphalpha D:\src\...\nms-gui
    `-- angular-cli@1.0.0-beta.4
      `-- broccoli-uglify-js@0.1.3
        +-- broccoli-filter@0.1.14
        | +-- broccoli-kitchen-sink-helpers@0.2.9
        | | +-- glob@5.0.15
        | | `-- mkdirp@0.5.1
        | +-- mkdirp@0.3.5
        | `-- walk-sync@0.1.3
        `-- uglify-js@2.4.24
          +-- async@0.2.10
          +-- source-map@0.1.34
          `-- yargs@3.5.4
            `-- wordwrap@0.0.2

    npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
    npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.12
    npm WARN optional Skipping failed optional dependency /browser-sync/chokidar/fsevents:
    npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.12

    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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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