closure fails on tsickle output [on a simple test case]
See original GitHub issuelatest compiler[^20170124.0.0] & tsickle[^2.1.6] (please help @mprobst @evmar @petebacondarwin @alexeagle @vikerman )
error build/testScript.js:2: ERROR - Required namespace “build_testDep” never defined. var testDep_1 = goog.require(‘build_testDep’);
command tsickle: “./node_modules/.bin/tsickle” --externs=build/externs.js
// tsconfig
{
"compilerOptions": {
"target": "es5",
"noImplicitAny": false,
"sourceMap": false,
"outDir": "build",
"module": "commonjs",
"noEmitHelpers": false
},
"include": [
"src/test*.ts"
],
"exclude": [
]
}
command compiler: java -jar ./node_modules/google-closure-compiler/compiler.jar --compilation_level ADVANCED --js build/*.js --js_output_file dist/p.js --output_wrapper "!function(){%output%}.call({});
// testScript.ts
import {Dep} from "./testDep";
class Test {
value: Dep;
constructor(val: Dep) {
this.value = val;
alert('still testing');
}
}
var t: Test = new Test(new Dep(1));
alert('i am compiled!');
(after tsickle)
goog.module('build.testScript'); exports = {}; var module = {id: 'build/testScript.js'};
var testDep_1 = goog.require('build_testDep');
var Dep = testDep_1.Dep; /* local alias for Closure JSDoc */
var Test = (function () {
/**
* @param {!Dep} val
*/
function Test(val) {
this.value = val;
alert('still testing');
}
return Test;
}());
function Test_tsickle_Closure_declarations() {
/** @type {!Dep} */
Test.prototype.value;
}
var /** @type {!Test} */ t = new Test(new testDep_1.Dep(1));
alert('i am compiled!');
// testDep.ts
class Dep {
value: Number;
constructor(val: Number) {
this.value = val;
}
}
export {Dep};
(after tsickle)
goog.module('build.testDep'); exports = {}; var module = {id: 'build/testDep.js'};
var Dep = (function () {
/**
* @param {!Number} val
*/
function Dep(val) {
this.value = val;
}
return Dep;
}());
exports.Dep = Dep;
function Dep_tsickle_Closure_declarations() {
/** @type {!Number} */
Dep.prototype.value;
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
tsickle breaks module names when outDir specified #481
Running tsickle produces almost valid output, except index.js ... goog.require('tsout_classB'); is causing the closure compiler to fail.
Read more >Closure Compiler With Webpack + Typescript
The Closure Compiler lets you choose from three levels of compilation, ranging from simple removal of whitespace and comments to aggressive code ...
Read more >tsickle
Tsickle is designed to do whatever is necessary to make the code acceptable by Closure compiler. We view its output as a necessary...
Read more >How to know testcases where code fails?
In stress testing, the idea is to generate random test cases and check the output of the brute force solution and the optimal...
Read more >Test Case Status - TechDocs - Broadcom Inc.
Usually a failed test case is related to at least one open defect. In fact, the workflow engine default rule set for defects...
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 FreeTop 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
Top GitHub Comments
Great guess! You are probably the first person to try this on Windows. 😃
i realize this is work in progress (and very appreciative of it). however, if this utility isn’t a standalone and only tested for angular setup environments - please state it in the docs. i was scratching my head for countless hours. I might not be the only one.
do you need me to change to headline to be descriptive of the bug ?