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
Because of the unfortunate combination of the following facts,
Meteor serves the entire app on any URL that it doesn't recognize,
angular-typescript-compilerinsists on taking control of the templateUrl so that it doesn't matter whether said URL is absolute or relative — The template always gets fetched from the current URL directory (absent a <base> tag in the HTML <head>),
RouterModule demands a base URL, and the first suggestion it provides is the one that fails to paper over the previous issue,
... it is quite easy to run into the situation where the app tries to render itself recursively, ad infinitum.
Browse http://localhost:3000/foo/bar and get infinite loop (Maximum call stack size exceeded ; Zone: <root> ; Task: Promise.then ; Value: RangeError: Maximum call stack size exceeded)
Meditate
Using the Chrome dev tools, discover that the app is issuing a query to http://localhost:3000/foo/client/imports/app/app.html, emphasis on /foo/ (which Meteor will serve the entire app for, including another occurence of the <app> tag, which causes the infinite recursion)
Go "aha, why don't I just set an absolute URL for the templateUrl?"
Because of the unfortunate combination of the following facts,
angular-typescript-compiler
insists on taking control of thetemplateUrl
so that it doesn't matter whether said URL is absolute or relative — The template always gets fetched from the current URL directory (absent a<base>
tag in the HTML<head>
),RouterModule
demands a base URL, and the first suggestion it provides is the one that fails to paper over the previous issue,... it is quite easy to run into the situation where the app tries to render itself recursively, ad infinitum.
This appears to have happened before to other people.
Steps that lead me here (with step-by-step reproduction instructions provided in my clone of
angular-meteor-base
):git clone https://github.com/Urigo/angular-meteor-base.git
No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document
Maximum call stack size exceeded ; Zone: <root> ; Task: Promise.then ; Value: RangeError: Maximum call stack size exceeded
)http://localhost:3000/foo/client/imports/app/app.html
, emphasis on/foo/
(which Meteor will serve the entire app for, including another occurence of the<app>
tag, which causes the infinite recursion)templateUrl
?"The text was updated successfully, but these errors were encountered: