-
Notifications
You must be signed in to change notification settings - Fork 109
closure fails on tsickle output [on a simple test case] #374
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
Comments
i consider this a simple "hello world" test case. if anything missing please tell me |
my friend (@evmar) I don't follow you. I gave the entire source and versions. it's two files. are you saying this is a bug? |
Yes, I think it's a bug. I was just dumping some notes about the relevant code. I'm not sure why it's misbehaving here. |
thanks for clarifying. isn't this tool widely used by the angular community ? (weird that it failed to figure out one dependency). any workarounds / suggestions ? i am closure depended. |
It's still a work in progress. We use it heavily within Google but our environment is different and doesn't cause this bug for whatever reason. |
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 ? |
@evmar my colleague tal obsfeld pointed out to me (and might be right): The main issue is that there is a '.' instead of '' ? They are replacing '/' on purpose to '.' for some reason I think the bug is actually with the output for testScript.ts line 2: My theory is that because we are running it on window, the file name is reported as 'build\testdep'. If you run the regex in pathToModuleName with this input, you'll get a '_' instead o '.'... If we can get it to run in linux then we are good, because we can configure the team city build to run the build on a linux agent machine |
Great guess! You are probably the first person to try this on Windows. :) |
this tool is a must so we ran it on linux as well and got this result ERROR - The body of a goog.module cannot reference this. we did the emithelper flag and got: ERROR - variable XXXX is undeclared (and) ERROR - variable __extends is undeclared closure simply refuses to compile tsickle output. |
Thanks, I filed separate issues about the problems you've uncovered. |
i appreciate your responsiveness. two questions:
|
The tsickle source, in the test_files directory, contains numerous small non-Angular TypeScript programs which compile with tsickle via its test suite. |
As an important help to the Angular developers, I would like to mention:
This |
latest 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
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
(after tsickle)
// testDep.ts
(after tsickle)
The text was updated successfully, but these errors were encountered: