Skip to content
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

jsii --watch is broken #1149

Closed
1 of 4 tasks
eladb opened this issue Dec 22, 2019 · 0 comments · Fixed by #1150
Closed
1 of 4 tasks

jsii --watch is broken #1149

eladb opened this issue Dec 22, 2019 · 0 comments · Fixed by #1150
Assignees
Labels
bug This issue is a bug. in-progress Issue is being actively worked on. p1

Comments

@eladb
Copy link
Contributor

eladb commented Dec 22, 2019

🐛 Bug Report

Affected Languages

  • TypeScript or Javascript
  • Python
  • Java
  • .NET (C#, F#, ...)

General Information

  • JSII Version: 0.20.11 (build d4fd44f), typescript 3.7.3
  • Platform: Mac

What is the problem?

jsii --watch always exits with the following error:

Error: Error: Unexpectedly returned from createWatchProgram
    at Compiler._startWatch (/Users/benisrae/code/cdk/aws-cdk/node_modules/jsii/lib/compiler.js:111:31)
    at Compiler.emit (/Users/benisrae/code/cdk/aws-cdk/node_modules/jsii/lib/compiler.js:60:25
@eladb eladb added the bug This issue is a bug. label Dec 22, 2019
@RomainMuller RomainMuller self-assigned this Dec 23, 2019
RomainMuller added a commit that referenced this issue Dec 23, 2019
A change in the TypeScript compiler API around how the compiler host
reacts when invoked in `--watch` mode caused a failure in `jsii` due to
the method changing behaviors from not returning at all when watching to
instead returning an object that can be used to inspect/influence the
background watch process.

Changed the behavior of the `Compiler` interface so it now acts as an
`EventEmitter` when operating in `--watch` mode, and introduced a test
that confirms that operating with `--watch` results in the correct
behavior of watching for file changes and dynamically re-compiling.

Fixes #1149
@SomayaB SomayaB added the in-progress Issue is being actively worked on. label Dec 23, 2019
@mergify mergify bot closed this as completed in #1150 Dec 30, 2019
mergify bot pushed a commit that referenced this issue Dec 30, 2019
* fix(jsii): `--watch` causes immediate failure

A change in the TypeScript compiler API around how the compiler host
reacts when invoked in `--watch` mode caused a failure in `jsii` due to
the method changing behaviors from not returning at all when watching to
instead returning an object that can be used to inspect/influence the
background watch process.

Changed the behavior of the `Compiler` interface so it now acts as an
`EventEmitter` when operating in `--watch` mode, and introduced a test
that confirms that operating with `--watch` results in the correct
behavior of watching for file changes and dynamically re-compiling.

Fixes #1149

* some PR feedback

* fix dummy project

* better encapsulate watch API

* Update packages/jsii/bin/jsii.ts

Co-Authored-By: Elad Ben-Israel <benisrae@amazon.com>

* expose ts API instead of wrapping it

Co-authored-by: Elad Ben-Israel <benisrae@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. in-progress Issue is being actively worked on. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants