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
{{ message }}
Repository navigation
Jsonp error Uncaught ReferenceError: __ng_jsonp____req0_finished is not defined after https://github.com/angular/angular/pull/13219 #14267
[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
hello, after upgrade to 2.4.6, I get Uncaught ReferenceError: __ng_jsonp____req0_finished is not defined as #13219 (comment)
Ok I think I have a better solution.
First of all we need to revert 9e5617e commit.
To avoid dots in callback name we need to add callback into the global namespace. I don't like the idea to pollute global namespace by default. So we should expose BrowserJsonp as a DI token (currently it's injectable but not exported) so users can provide their own implementation (or extend and override particular methods) with their own callback names etc.
@dejour callback name must end with .finished. Some apis don't allow callback names with dots. To avoid dots we need to add callbacks directly to window. Don't think polluting window by default is a good idea
But for my bad luck, still doesn't work, I update to @angular/http@2.4.7, even delete and make the npm to recreate that folder, but still get the same error.
Or maybe I am doing something wrong, ( I am using Angular-CLI "version": "1.0.0-beta.28.3")
Activity
DzmitryShylovich commentedon Feb 3, 2017
Pls add a plunkr with repro
doxiaodong commentedon Feb 3, 2017
@DzmitryShylovich , done
DzmitryShylovich commentedon Feb 3, 2017
Callback must have dot before finished
__ng_jsonp____req0.finisheddoxiaodong commentedon Feb 3, 2017
@DzmitryShylovich , I make a simple pr to fix. If you have a better way, close this.
DzmitryShylovich commentedon Feb 3, 2017
I'll take a look thx
DzmitryShylovich commentedon Feb 3, 2017
btw discussion about dot in callback names from ng1 angular/angular.js#1551 (comment)
DzmitryShylovich commentedon Feb 3, 2017
Ok I think I have a better solution.
First of all we need to revert 9e5617e commit.
To avoid dots in callback name we need to add callback into the global namespace. I don't like the idea to pollute global namespace by default. So we should expose
BrowserJsonpas a DI token (currently it's injectable but not exported) so users can provide their own implementation (or extend and override particular methods) with their own callback names etc.@mhevery what do you think about that?
dejour commentedon Feb 3, 2017
but implementation function name is always
finished.so i thinkJSONPCALLBACKis fine. all user care about is returned data.DzmitryShylovich commentedon Feb 3, 2017
@dejour callback name must end with
.finished. Some apis don't allow callback names with dots. To avoid dots we need to add callbacks directly towindow. Don't think pollutingwindowby default is a good ideadoxiaodong commentedon Feb 3, 2017
Greate, I make an example with no dot about @DzmitryShylovich 's pr.
custom-browser-jsonp.tsKlerith commentedon Feb 9, 2017
What is the status of this issue?
I have the same problem using jsonp module
DzmitryShylovich commentedon Feb 9, 2017
@Klerith will be fixed in the next release. Use
2.4.5version of http moduleKlerith commentedon Feb 9, 2017
Thank you for the super fast reply @DzmitryShylovich ,
But for my bad luck, still doesn't work, I update to @angular/http@2.4.7, even delete and make the npm to recreate that folder, but still get the same error.
Or maybe I am doing something wrong, ( I am using Angular-CLI "version": "1.0.0-beta.28.3")
Thank you for anything you can tell me
DzmitryShylovich commentedon Feb 9, 2017
@Klerith the bug was introduced in 2.4.6. So you need to use 2.4.5
Klerith commentedon Feb 9, 2017
@DzmitryShylovich, If you live in Costa Rica, I will invite you to a good coffee for this excellent support.
I will use that HTTP version (2.4.5) until I the next release comes out.
Thank you so much! That fixed my issue.
gastonkirsman commentedon Feb 10, 2017
@DzmitryShylovich Great!
With @angular/http 2.4.5 jsonp requests work.
search results jsonp to deezer, limit to angular 2.4.5 due to angular…
fix(http): REVERT: remove dots from jsonp callback name (#13219)
DzmitryShylovich commentedon Feb 18, 2017
@doxiaodong the commit that caused this bug was reverted so it can be closed
doxiaodong commentedon Feb 20, 2017
close
erneledesma commentedon Feb 12, 2019
Hi all! I have the following problem to want to make the request .. I do not realize about the error..



I appreciate any suggestions
angular-automatic-lock-bot commentedon Sep 14, 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.