You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
When compiling project with ngc and typescript@2.1.1 compilation fails with: Metadata emit requires the sourceFiles are passed to WriteFileCallback. Update to TypeScript ^1.9.0-dev
When downgrading typescript to 2.0.10 the compilation is successful.
Expected behavior
ngc should compile project with typescript@2.1.1.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
macOS@10.12.1
node@v6.9.1
angular@2.2.1
typescript@2.1.1
Angular version: 2.0.X
Yes.
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Reacted by Rafael Munitić, Andrew Crites, Marc Remolt, Simon Schick, Cotton Hou, Laurent Goudet, fredrikredflag, bromzh, Niklas, Minko Gechev and 10 more
In my case running ngc does not fail with an error but the output directory only contains AoT files for node_modules.
Using the typescript 2.0.x produces correct/expected output.
You can check out the project here - do npm run ngc and it will create correct output in the build/aot folder, upgrade to typescript 2.1.x and retry and you will only see build/aot/node_modules.
I would really like to get babel out of my build process and TS 2.1 finally implements ES5 async/await emit but this is a blocking issue before upgrading (I've also seen closed issues reporting the same problem without a solution eg. #11689)
@rubber-duck The repo you reference uses "skipMetadataEmit": true which passes since the compiler never tries to emit the metadata but I too only see node_modules and non of the projects factories.
I did a little debugging on rubber-duck's problem.
One of the reasons seems to be line 187 in tsc-wrapped's collector.js: if (node.flags & ts.NodeFlags.Export) {
Here, ts.NodeFlags.Export is undefined in Typescript 2.1.
I've made further digging, it turns out in TS v2.1 should use ModifierFlags instead of NodeFlags, I opened PR #13081 as first step of migration, once goes merged could easily make the final change as showed in draft PR imcotton#1.
I digged deep into a similiar issue today - ng-xi18n did produce my .xlf file but it had no content.
TypeScript changed the "NodeFlags" ENUM, in 2.0.10 it was "Export", in ^2.1 it is "ExportContext".
There where more changes like these so currently NG2 isn't (fully) compatible with TS ^2.1
Downgrading TS to 2.0.10 currently solved my problem.
Activity
DzmitryShylovich commentedon Nov 18, 2016
Pls provide a minimal repo with reproduction.
blaugold commentedon Nov 18, 2016
This repo has two branches: ts-2.1.1 and ts-2.0.10.
rm -rf node_modules && npm ioryarnnpm run buildts-2.0.10 compiles fine, ts-2.1.1 gives me the mentioned error.
rubber-duck commentedon Nov 18, 2016
In my case running ngc does not fail with an error but the output directory only contains AoT files for node_modules.
Using the typescript 2.0.x produces correct/expected output.
You can check out the project here - do
npm run ngcand it will create correct output in thebuild/aotfolder, upgrade to typescript 2.1.x and retry and you will only seebuild/aot/node_modules.I would really like to get babel out of my build process and TS 2.1 finally implements ES5 async/await emit but this is a blocking issue before upgrading (I've also seen closed issues reporting the same problem without a solution eg. #11689)
blaugold commentedon Nov 18, 2016
@rubber-duck The repo you reference uses
"skipMetadataEmit": truewhich passes since the compiler never tries to emit the metadata but I too only seenode_modulesand non of the projects factories.rubber-duck commentedon Nov 18, 2016
@blaugold I tried removing that line to see if I could reproduce before I posted and I couldn't get the error (I'm on windows btw.)
But in either case the AoT doesn't work with TS 2.1
gustavLatte commentedon Nov 20, 2016
In my case, similar to @rubber-duck the AOT output folder contained only the
angularandangularfire2folders under thenode_modulesfolder.jimmytheneutrino commentedon Nov 24, 2016
I did a little debugging on rubber-duck's problem.
One of the reasons seems to be line 187 in tsc-wrapped's collector.js:
if (node.flags & ts.NodeFlags.Export) {Here, ts.NodeFlags.Export is undefined in Typescript 2.1.
This corresponds to the line in the source.
imcotton commentedon Nov 25, 2016
@jimmytheneutrino thank you for the hint
I've made further digging, it turns out in TS v2.1 should use
ModifierFlagsinstead ofNodeFlags, I opened PR #13081 as first step of migration, once goes merged could easily make the final change as showed in draft PR imcotton#1.chore: downgrade typescript
actra-gschuster commentedon Dec 1, 2016
I digged deep into a similiar issue today - ng-xi18n did produce my .xlf file but it had no content.
TypeScript changed the "NodeFlags" ENUM, in 2.0.10 it was "Export", in ^2.1 it is "ExportContext".
There where more changes like these so currently NG2 isn't (fully) compatible with TS ^2.1
Downgrading TS to 2.0.10 currently solved my problem.
Upstream merge (#8)
Squashed last changes from mgechev/angular-seeed
Upstream merge (#9)
Upstream merge (#9) (#1)
Upstream merge (#2)
lacolaco commentedon Dec 8, 2016
Relates to #13204
jamespacileo commentedon Dec 13, 2016
Any news on this issue? Ionic framework suffers from the same issue.
lacolaco commentedon Dec 13, 2016
@jamespacileo they're working on this. see #13294
Upstream merge (#14)
Upstream merge (#14) (#3)
Upstream merge (#15)
Upstream merge (#4)
Upstream merge (#16)
Upstream merge (#17)
Upstream merge (#18)
Upstream merge (#5)
angular-automatic-lock-bot commentedon Sep 10, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.