TypeError: e.response undefined
-
I am getting a TypeError: e.response undefined in the App.js file when trying to save changes.
-
Thanks for the report.
Probably bad error handling on my part, same as a few others have reported. It’s mostly likely due to the fact that the WordPress server is sending back some unexpected output that can’t be parsed as JSON.
When I’ve seen this happen before, it’s because there is some other theme or plugin that you have installed that’s emitting that output when the server is doing the “save changes” work.
I expect to be pre-releasing a major update to this plugin in the coming week, which I expect to fix this problem, among others.
In the meantime, if this is the cause, you can get a clue as to which theme or plugin is causing it by inspecting the network tab in the console (I’ll assume Chrome, since I’m most familiar with its Dev Tools).
Look for a request that ends in:
font-awesome/v1/config
For example, it might be:
index.php?rest_route=/font-awesome/v1/config
Look at the response on that request. It should be JSON data. If it’s anything else, then whatever it is will probably provide a clue as to which other plugin or theme is responsible for the unexpected output.
Also, if you’re willing to live on the edge a little, it would help if you could download and try out this pre-release. I haven’t yet published it to the plugins directory (still working on documentation), but the code seems ready.
Thanks so much for the quick reply. I could not find that particular request however I know I have conflicts. I have three plugins that have Font Awesome included.
Those three plugins are:
1. Theme – Brooklyn by Unitedthemes
2. DP Pro Event Calendar
3. UserPro by Deluxe ThemesI tested your pre-release version and have come across and error when i try to use the scanner as well as save settings. That error is:
Font Awesome WordPress Plugin Error Report reportRequestError.js:135:10 message: There was an error attempting to report the error. code: fontawesome_unknown_error reportRequestError.js:57:12
Interesting.
Well, that at least confirms that something really unexpected is coming back from the WordPress server. Unfortunately, it’s not quite enough information for me to solve it, though it shows me where I can improve the diagnostic output. I’ll make that tweak before the upcoming release.
Here’s an animated GIF showing network request diagnostic in Google Chrome developer tools.
It would be really helpful if you could let me know what content is in those network responses you are getting back from the WordPress server.
Thanks for the gif. I use Firefox Developer edition but the process is basically the same. Here are some screenshots, nothing on the response.
There’s never case where the Font Awesome plugin would return an HTTP 200 status response with an empty body. So that shows that some unexpected output is being emitted back to the browser before the Font Awesome plugin gets a chance to do its intended response.
If you have WP_DEBUG set to true in your wp-config.php without WP_DEBUG_LOG also set to true, then it might be that there’s some debug warning or error that’s being emitted and causing such a problem. If so, then you might be able to resolve that problem by either setting WP_DEBUG to false, so the warnings or errors are not being emitted, or you could set WP_DEBUG_LOG to true to cause all of that to be sent to a debug.log file instead of being emitted back to the browser. In fact, setting WP_DEBUG and WP_DEBUG_LOG both to true (at least temporarily) and then seeing if anything shows up in the debug.log could be another way to identify the root cause of the problem.
It is also possible for that state to occur when some other theme or plugin emits output back to the browser it shouldn’t during a REST API call. Unfortunately, the Font Awesome plugin doesn’t have much, if any, control over that. I’m still trying to figure out how to either suppress or otherwise handle such unexpected output, or if that’s not possible, at least try to provide some more informative error diagnostics from the Font Awesome plugin.
One way to isolate such a problem is to disable every other plugin, try your scenario and make sure it works as expected, and then reactivate each plugin until you see the problem condition occur again. That would isolate the root cause, which would at least suggest possible solutions.
Another thing to check: Are you on WordPress 5.2+?
If so, could you run the site health under Tools->Site Health?
I’d like to know whether you see any errors for the REST API health test.
So i have been poking around. I am on 5.2. I also turned off caching on my site as i feel is was hiding things. I now see the response was providing a 404 not found error. I looked at site health and see that i have an error on the rest API not being able to perform a loopback.
Through the process of disabling and enabling plugins i have found that this is a plugin conflict cause by “UserPro” which is how users register for my site. So important plugin for me.
Now if i try to run your plugin as the only plugin active i get a 403 error with a message of
Cookie nonce is invalid
The Cookie nonce invalid message suggests that your browser has an outdated WordPress authentication cookie or nonce. Could you trying logging out of wp-admin and logging in again, and then try again to save some settings in the Font Awesome plugin?
I just released
4.0.0-rc15
to the plugins directory.Could you give it a try and let me know how it goes?
It just crashed site here.
Notice: Undefined index: version in /home/lestradesign/poly.lestradesign.com/wp-content/plugins/font-awesome/includes/class-fontawesome.php on line 386
Fatal error: Uncaught Error: Cannot use object of type Closure as array in /home/lestradesign/poly.lestradesign.com/wp-content/plugins/revslider/admin/revslider-admin.class.php:472 Stack trace: #0 /home/lestradesign/poly.lestradesign.com/wp-includes/class-wp-hook.php(288): RevSliderAdmin->merge_addon_notices(”) #1 /home/lestradesign/poly.lestradesign.com/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) #2 /home/lestradesign/poly.lestradesign.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #3 /home/lestradesign/poly.lestradesign.com/wp-admin/admin.php(170): do_action(‘admin_init’) #4 /home/lestradesign/poly.lestradesign.com/wp-admin/plugins.php(10): require_once(‘/home/lestrades…’) #5 {main} thrown in /home/lestradesign/poly.lestradesign.com/wp-content/plugins/revslider/admin/revslider-admin.class.php on line 472
There has been a critical error on your website. Please check your site admin email inbox for instructions.
@lestra thanks for the report. I’m investigating.
@lestra could you try to deactivate and reactivate the Font Awesome plugin?
Already tried. Also reinstalled…same.
OK, well here’s what I can see so far:
Looks like that revslider plugin assumes that it can process all of the callbacks on the
admin_notices
queue as if they were arrays. I’m using a closure at that point, so it chokes on that. I’m going to change my code not to use closures in those cases. So I expect that change to clear up that issue.But I’m not sure that it explains the part of about the missing “version” index. That might be the root cause, which causes the Font Awesome plugin to throw an exception. It tries to handle it by posting an admin notice. And apparently, revslider is trying to do some post-processing of the admin notices–and choking on the closure.
Do you have access to wp-cli or the WordPress database for this site?
It would help if I could see the contents of the option in the db called
font-awesome
. If you have access to wp-cli, you could this by doing:
wp option get font-awesome
- The topic ‘TypeError: e.response undefined’ is closed to new replies.