Skip to content

incremental rebuilds do not include updates to .ts files #206

Closed
@jamesarosen

Description

@jamesarosen

Environment

node 8.11.1
ember-cli 3.1.4
ember-cli-typescript: 1.3.0
typescript: 2.8.3

// ember-cli-build.js
'use strict'
const EmberApp = require('ember-cli/lib/broccoli/ember-app')
module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    hinting: false,
  })
  if (app.env === 'development') {
    app.import('vendor/csp-script-test.js')
  }
  app.import('vendor/google-analytics.js')
  return app.toTree()
}

Problem

When I run DEBUG=ember-cli-typescript* ember serve

  1. if I change an app/**/*.js file, ember-cli ✅ sees the change, ✅ rebuilds, ✅ tells the browser to refresh, and ✅ responds with the updated /assets/myapp.js.
  2. if I change an app/**/*.ts file, it does all of those steps except the last. That is, the page refreshes, but the compiled JavaScript does not reflect my recent changes.
  3. if I change a .ts file and then a .js file only the .js changes are reflected in myapp.js.
  4. if I change a .ts file and then touch the same file, no changes are reflected in myapp.js.

I get the following debug output when I change app/components/my-component.ts (and when I touch it):

file changed components/my-component.ts
  ember-cli-typescript:compiler-state broccoliDidStart | broccoli: 1 active nodes | tsc: idle (0 errors) +18s
  ember-cli-typescript:compiler-state broccoliDidEnd | broccoli: 0 active nodes | tsc: idle (0 errors) +0ms
  ember-cli-typescript:compiler-state broccoliDidStart | broccoli: 1 active nodes | tsc: idle (0 errors) +209ms
  ember-cli-typescript:compiler-state broccoliDidEnd | broccoli: 0 active nodes | tsc: idle (0 errors) +0ms
  ember-cli-typescript:compiler-state broccoliDidStart | broccoli: 1 active nodes | tsc: idle (0 errors) +1ms
  ember-cli-typescript:compiler-state broccoliDidEnd | broccoli: 0 active nodes | tsc: idle (0 errors) +0ms
  ember-cli-typescript:compiler-state broccoliDidStart | broccoli: 1 active nodes | tsc: idle (0 errors) +339ms
  ember-cli-typescript:compiler-state broccoliDidEnd | broccoli: 0 active nodes | tsc: idle (0 errors) +0ms

On [email protected], I get the same behavior with slightly different logging output:

file changed components/my-component.ts
  ember-cli-typescript:compiler broccoli detected a file change +11s
  ember-cli-typescript:compiler waiting for tsc output {} +0ms
  ember-cli-typescript:autoresolve no tsc rebuild; autoresolving... +32s
  ember-cli-typescript:compiler tsc build complete {} +505ms
  ember-cli-typescript:compiler waiting for tsc output { mirage: 'app/mirage' } +212ms
  ember-cli-typescript:compiler tsc build complete { mirage: 'app/mirage' } +1ms
  ember-cli-typescript:compiler waiting for tsc output { './app': 'app' } +1ms
  ember-cli-typescript:compiler tsc build complete { './app': 'app' } +0ms
  ember-cli-typescript:compiler waiting for tsc output { tests: 'tests' } +604ms
  ember-cli-typescript:compiler tsc build complete { tests: 'tests' } +0ms

Per #158, I've tried VSCode, vi, and touch to modify the file.

Possibly related to #125, #158, #204

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