Issue with TypeScript 2.9.1
See original GitHub issueExpected Behaviour
Code should include a require to run properly.
Actual Behaviour
require is missing in generated code
Steps to Reproduce the Problem
Not sure.
Location of a Minimal Repository that Demonstrates the Issue.
I have a file and when I’m compiling using TypeScript 2.9 I get the following:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const graph_1 = __webpack_require__(50);
class CollectionGraphStore extends graph_1.GraphStore {
constructor() {
super(new ProcedureGraphOptions_1.ProcedureGraphOptions());
....
As you can see ProcedureGraphOptions_1
is not included.
If I generate the same code using TypeScript 2.8.3, then I get:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const graph_1 = __webpack_require__(51);
const ProcedureGraphOptions_1 = __webpack_require__(122);
class CollectionGraphStore extends graph_1.GraphStore {
constructor() {
super(new ProcedureGraphOptions_1.ProcedureGraphOptions());
....
Unfortunately I’m at loss at why it is not generating the missing require. If I use tsc
2.9.1 from the command line to generate the JavaScript code, the code is properly generated:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const graph_1 = require("Controls/graph");
const ProcedureGraphOptions_1 = require("Experiment/procedures/ProcedureGraphOptions");
class CollectionGraphStore extends graph_1.GraphStore {
constructor() {
super(new ProcedureGraphOptions_1.ProcedureGraphOptions());
...
Any idea?
Issue Analytics
- State:
- Created 5 years ago
- Comments:41 (12 by maintainers)
Top Results From Across the Web
Documentation - TypeScript 2.9
TypeScript 2.9 adds support for number and symbol named properties in index types and mapped types. Previously, the keyof operator and mapped types...
Read more >Typescript error after updating from version 2.9.2 to 3.7.5
After updating typescript I get a compilation error on one of the libs - https://github.com/jf3096/json-typescript-mapper - This lib is not ...
Read more >TypeScript 2.9 is now available - Hacker News
DT has a problem in that they try to track the semver breaks of upstream in their npm packages, but don't have a...
Read more >TypeScript 2.9 for Visual Studio 2017
More Info ; Version, 2.9.1 ; Version, 2.9.1. Released on, 5/31/2018, 4:07:46 PM ; Last updated. 5/31/2018, 4:07:46 PM ; Publisher ; Report,...
Read more >Microsoft.TypeScript.Compiler 2.9.1 - NuGet
Microsoft.TypeScript.Compiler 2.9.1 ... The ID prefix of this package has been reserved for one of the owners of this ... There is a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like the issue should be fixed in 2.9.2!
https://github.com/Microsoft/TypeScript/issues/24551
typescript@2.9.2
is available now, and should include the fixes for both repros in this thread.