typescript - "Error: Debug Failure. False expression: Output generation failed" when Importing Custom Declarations File in Angular 2 Service -


i have old, yucky javascript file full of stuff need make available angular service, , cannot figure out how it. i'm suprised @ how hard find tutorial this. maybe i'm out of loop don't know how ask question...

i've created declaration file (let's it's called oldstuff.d.ts).

clarification: declaration file only. actual code lives in different file: oldstuff.js

at top of angular service, i'm importing declaration file this:

import './oldstuff.d'; 

i not doing else anywhere in application attempt declaration file included.

this import enough vs code recognize definitions, , intellisense working expect.

in fact, can use angular cli build project, , seems build ok.

however, try inject service constructor elsewhere in application, build fails following error:

error in ./src/app/oldstuff.d.ts module build failed: error: debug failure. false expression: output generation failed     @ object.assert (c:\projects\angular\myapp\node_modules\typescript\lib\typescript.js:3329:23)     @ object.transpilemodule (c:\projects\angular\myapp\node_modules\typescript\lib\typescript.js:80449:18)     @ typescriptfilerefactor.transpile (c:\projects\angular\myapp\node_modules\@ngtools\webpack\src\refactor.js:166:27)     @ promise.resolve.then.then.then.then (c:\projects\angular\myapp\node_modules\@ngtools\webpack\src\loader.js:414:37)  @ ./src/app/my-app.module.ts 23:0-34  @ ./src/main.ts  @ multi ./src/main.ts 

i have googled both specific error message, , generic information on how include declaration files, , i'm coming dry.

here of things i've looked at:

am hitting legit bug, or doing wrong?

solution?

well, seems dumb, had remove letter 'd' name of file.

so, instead of this:

//actual filename: oldstuff.d.ts import './oldstuff.d'; 

i have this:

//actual filename: oldstuff.ts import './oldstuff' 

and builds , works @ runtime expected. don't understand typescript enough understand whether that's expected behavior or not. hunch it's not , bug, have no idea...


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -