AOT Fail
See original GitHub issueI use couple of RXJS operators, I have added them in gulpfile.js
// A list of IDs of modules that should remain external to the bundle
// See https://github.com/rollup/rollup/wiki/JavaScript-API#external
external: [
'@angular/core',
'@angular/common',
'@angular/http',
'rxjs/Observable',
'rxjs/Subject',
'rxjs/add/observable/timer',
'rxjs/add/operator/do',
'rxjs/add/operator/takeWhile',
'rxjs/add/operator/switchMap'
],
gulp build output:
[02:29:00] Finished 'ngc' after 1.41 s
[02:29:00] Starting 'rollup:fesm'...
build/services/browser-xhr.provider.js (1:17) The 'this' keyword is equivalent to 'undefined' at the to
p level of an ES module, and has been rewritten
build/services/browser-xhr.provider.js (1:25) The 'this' keyword is equivalent to 'undefined' at the to
p level of an ES module, and has been rewritten
[02:29:00] Finished 'rollup:fesm' after 159 ms
[02:29:00] Starting 'rollup:umd'...
build/services/browser-xhr.provider.js (1:17) The 'this' keyword is equivalent to 'undefined' at the to
p level of an ES module, and has been rewritten
build/services/browser-xhr.provider.js (1:25) The 'this' keyword is equivalent to 'undefined' at the to
p level of an ES module, and has been rewritten
No name was provided for external module '@angular/core' in options.globals – guessing '_angular_core'
No name was provided for external module '@angular/common' in options.globals – guessing '_angular_comm
on'
No name was provided for external module 'rxjs/Subject' in options.globals – guessing 'rxjs_Subject'
No name was provided for external module 'rxjs/Observable' in options.globals – guessing 'rxjs_Observab
le'
No name was provided for external module '@angular/http' in options.globals – guessing '_angular_http'
[02:29:00] Finished 'rollup:umd' after 64 ms
I don’t understand why I am getting these errors!
Now when I import the dist package in a new app, I get no errors while compiling, but it is broken at runtime, getting these errors:
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Attack On Titan: Eren's 10 Biggest Failures, Ranked - CBR
While Eren technically succeeds in this case, it is an ethical failure of massive proportions. 3/10 He Openly Declares War On The World....
Read more >Attack On Titan: Eren's Worst Mistakes & Failures - Game Rant
In Attack on Titan, Eren has made plenty of bad decisions. These examples, however, are some of his worst mistakes.
Read more >Identifying AOT compilation failures - IBM
As with the JIT, first run your application with -Xnoaot, which ensures that the AOT'ed code is not used when running the application....
Read more >Eren Yeager's 10 biggest failures in Attack on Titan
Here are Eren Yeager's 10 biggest failures and mistakes in Attack on Titan. Using Falco as a pawn comes in Eren's 10 biggest...
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
@diego-d5000 I finally found the reference! It was buried in my search history from yesterday 😄
See #126
To give you an example:
My library has 3 components:
Library module exports component Component FooBar
So my
src/index.ts
looks like this:I believe this will cause the Warnings mentioned in #149 and #126.
So to fix it you would have to edit
src/index.ts
as follows:To be honest I didn’t know if this was necessary to begin with but I assumed I could only export what I wanted the library users to use and not to have to export everything. In this case I think is a valid scenario to only want to export fooBar and not foo or bar individually.
To be even more honest I’m not sure what I should be exporting or if I could leave anything out from
src/index.ts
but what I did was add an export for every module, component, service or class my library uses internally.Be that as it may, this fixed both the Warnings and the Runtime error for me.
@sebastianteres — Thank you so much for sharing, much appreciated! 👍