Rails 5.1.5 upgrade causes - uninitialized constant Mime::JSON - ruby-on-rails-5.1

Whenever a controller renders json I get,
uninitialized constant Mime::JSON
I have not modified any code related to this.
Ex, the code for this controller method that throws the error:
def names
#families = Family.pluck(:name)
render json: #families
end
This was working fine before the rails 5 upgrade.

In my case, it was jbuilder causing this error.
Upgrading jbuilder to latest (2.7.0 at time of writing) solved this. The old jbuilder references JSON wrong and causes responder to fail.

I was obtaining the error after upgrade from rails 5.0.1 to 5.1.0 and in my case the gem 'web-console','~> 2.0' was causing the error, I solved it updating it to gem 'web-console','>= 3.3.0'.

Related

Error: Property left of ForInStatement is null?

yesterday I was able to create my react babylon app with react-scripts. After updating babylon to 4.1.0 I receive the following error:
./node_modules/babylonjs/babylon.js TypeError:
/git/proconf_sa/node_modules/babylonjs/babylon.js: Property left of ForInStatement expected node to be of a type [“VariableDeclaration”,“LVal”] but instead got null
Any idea what the problem could be? I updated from version 3.1.0-alpha3.7.
Thanks.
I was facing the same problem, however using Angular. I resolved by removing a package that uses svg.js#2.7.1 !!! From what you discover, this error is caused by the discontinued version of svg.js#2.7.1 !!! Look inside your application that there is a package using this and remove it!
If using apexcharts update it, because it depends on svg.js!
(NOTE: Sorry for possible errors in my writing, I'm Brazilian, I'm having to use Google translator to write this)

AngularJS 1.7.9 : how to debug "Possibly unhandled rejection: {}"?

I am aware of siiar questions, such as Angularjs 1.7.9 - Possibly unhandled rejection and those mentioned in it as duplicates.
However, my code does not use promises (that I am aware of; certainly no $promise or $http).
I am just knocking up a simple ui-router demo for a friend. It is just two views, each with a button that toggles to the other view. It works just fine with AngulrJs 1.5, and breaks with the above error in 1.7.
A simple as it is, it's a bit too much code to post. In case, rather than finding the error in my code, I woudl like a canonical answer to help others who read this question in future : how to go about denugging this error message?
Error: transition failed (caused by "Possibly unhandled rejection: {}")
at r [as $get] (http://localhost/common/js/third_party/ui-router_zero_pint_2_point_11/angular-ui-router.min.js:7:11365)
at Object.invoke (http://localhost/common/js/third_party/angular-1_point_7_point_9/angular.min.js:45:62)
at http://localhost/common/js/third_party/angular-1_point_7_point_9/angular.min.js:46:365
at d (http://localhost/common/js/third_party/angular-1_point_7_point_9/angular.min.js:43:495)
at e (http://localhost/common/js/third_party/angular-1_point_7_point_9/angular.min.js:44:235)
at Object.invoke (http://localhost/common/js/third_party/angular-1_point_7_point_9/angular.min.js:44:320)
at http://localhost/common/js/third_party/angular-1_point_7_point_9/angular.min.js:47:18
at r (http://localhost/common/js/third_party/angular-1_point_7_point_9/angular.min.js:8:76)
at fb (http://localhost/common/js/third_party/angular-1_point_7_point_9/angular.min.js:46:499)
at c (http://localhost/common/js/third_party/angular-1_point_7_point_9/angular.min.js:22:57)
The latest version of UI-router (1.0.25) solved the problem. Feel free to post an answer.
You will get a more informative stack trace if you use angular.js instead of angular.min.js and angular-ui-router.js instead of angular-ui-router.min.js. Angular-UI-Router uses promises in its transition module. It looks like you upgraded your version of AngularJS without upgrading the version of Angular-UI-Router. Upgrade your router from V0.2.11 to V0.4.3. It looks like your problem is caused by sloppy Angular-UI-Router code. If they didn't fix the issue by V0.4.3, you can either patch the library or live with the messages.
Debugging "possibly unhandled rejection"
The stack trace will show the file and the line number from which the error originates. Examine the code and fix the problem. If the error orginates in a third- party library, try upgrading to the latest version or contacting the third-party library vendor.
As a last resort, disable the "possibly unhandled rejection" messages:
app.config(functon ($qProvider) {
$qProvider.errorOnUnhandledRejections(false);
});
This is not recommended as it allows other problems to silently fail.
If one doesn't care about a specific promise failing, add a .catch handler:
$http(config).then(function(response) {
//...
}).catch(function(response) {
//I don't care about errors
if (debug) console.log(response);
//Re-throw error response
throw response;
})
Upgrading AngularJS
When upgrading AngularJS, it is best to upgrade all of the AngularJS modules at the same time. That is when migrating from angular.js#1.4 to angular.js#1.5, at the same time upgrade to angular-animate#1.5, angular-resource#1.5, angular-route.js#1.5, etc. I have seen unpleasant problems when trying to mix and match versions of AngularJS modules.
When migrating, I recommend upgrading one minor version at a time. For example, upgrade from V1.4 to V1.5 first, fix what breaks, then upgrade to V1.6.
The current version is 1.7.9 pollution-eradication (2019-11-19). I recommend using the latest version as the AngularJS team has committed to fixing security bugs only in both V1.2.x and the latest version.
For more information, see
AngularJS Developer Guide - Migrating from Previous Versions
AngularJS Version Support Status - Long Term Support
Upgrading Angular-UI-Router
UI-Router for AngularJS has two major versions
Version 0.4.3 UI-Router-Legacy
Version 1.0.25 UI-Router for AngularJS
I recommend upgrading to the latest version of UI-Router-Legacy before migrating to the latest version of UI-Router for AngularJS. There have been major breaking changes between the two and it is best to deal with it incrementally.
For more informaton, see
Angular-UI Guide: UI-Router 1.0 Migration
One way to debug ui-router is the following:
From the console inject the $state service typing the following:
var test = angular.element(document.body).injector().get('$state');
Then simulate and perform the transition that causes the problem:
test.go('root.details') // use the state url here
After that, details of the transition will be printed in console. Into $$state object, you may find more details about the failed transition and reasons of failure:

firebase-auth.html - Uncaught type error: Cannot read property 'token' of undefined

I cloned the following Polymer todo-list app from https://github.com/PolymerLabs/todo-list and after setting it up as per the instructions, i got it running on local with gulp serve. I could signin and add/delete/update todos as expected. However, a colleague of mine who did the same thing is getting the following error
My colleague is working from the Philippines if that matters at all. Could someone please advise how I can get it working on his local machine? We're both using Chrome btw and he does not run into any issues using a version that was deployed to firebase, just encountering the error on localhost. Thanks.
The issue was caused by the firebase element as explained here. Updating the firebase element solved the problem.

strange angular bug: angular.element('<option-anything>') fails

I just noticed that
angular.element('<option-anything>')
fails to compile. It returns an empty array. It seems to be related to the phrase "option-".
any insights?
it appears to be a bug in the lastest version of angular.js

TypeError in qx.ui.mobile.core.EventHandler after update to qooxdoo 1.5

After updating to qooxdoo 1.5 I am seeing this error:
Uncaught TypeError: Expecting a function in instanceof check, but got #<HTMLDocument>
:8080/qooxdoo-1.5-sdk/framework/source/class/qx/ui/mobile/core/EventHandler.js?nocache=0.38786523090675473:245
Strange thing is, that I am not using the qx.ui.mobile.* classes at all. This is with a source-all build and "qx.debug" set.
As for including the qx.ui.mobile.* classes, this comes from using the source-all job, which includes, well, all known classes, also the qx.ui.mobile.* ones. Try using the normal source job, which only includes the classes necessary for your app.
As for the error, please open a bug report at http://bugzilla.qooxdoo.org. Please specify the OS and browser you are using when you get the error. If possible, supply a minimal Application.js (or a Playground link) that reproduces the error. Cheers.

Resources