Hi,
I recently upgraded my Ember app from 3.9 to 3.10, and my Rails app from 4.x to 5.x. My form data used to work fine, but now it does not - it reports a JSON::ParseError.
Looking at the package.json I see that your add-on did not change => I assume the same form data params are being sent to the server.
The Rails gemfile.lock file informs me that the json gem went from 1.8.3 to 2.2.0 (major number change => uh, oh... as we all know ;-)
Given that your add-on stayed the same and the json gem changed a lot tells me that the problem is most likely on their end. I am asking this same question on their "Issues" page; I am asking it here because maybe someone has run into this problem and can help me out. (Obviously, if I get an answer over there I will post it here so that maybe it will help others.)
My form isn't that complicated; just the usual stuff with a user-image capability. Also, I figure that this add-on must be used a lot with the latest Ruby/Rails JSON gem => seems like this should "just work" like it used to.
Below is the output I am seeing. Any help will be greatly appreciated, as I am stuck with not being able to create/update users. BTW, I tried backing off the JSON gem from 2.2.0 to 1.8.3 but could not do it due to a variety of bundler errors.
Thanks,
Larry
===============================
JSON::ParserError at /spa/users
785: unexpected token at '------WebKitFormBoundaryyBVIQZp7P07Edby7
Content-Disposition: form-data; name="user[state]"
MA
------WebKitFormBoundaryyBVIQZp7P07Edby7
Content-Disposition: form-data; name="user[district]"
3
------WebKitFormBoundaryyBVIQZp7P07Edby7
Content-Disposition: form-data; name="user[username]"
joesmith
------WebKitFormBoundaryyBVIQZp7P07Edby7
Content-Disposition: form-data; name="user[email]"
[email protected]
------WebKitFormBoundaryyBVIQZp7P07Edby7
Content-Disposition: form-data; name="user[password]"
pword
------WebKitFormBoundaryyBVIQZp7P07Edby7
Content-Disposition: form-data; name="user[first_name]"
Joe
------WebKitFormBoundaryyBVIQZp7P07Edby7
Content-Disposition: form-data; name="user[last_name]"
Smith
------WebKitFormBoundaryyBVIQZp7P07Edby7
Content-Disposition: form-data; name="user[password_confirmation]"
pword
------WebKitFormBoundaryyBVIQZp7P07Edby7--
'
json (2.2.0) lib/json/common.rb, line 156
151 # additions even if a matching class and create_id was found. This option
152 # defaults to false.
153 # * *object_class*: Defaults to Hash
154 # * *array_class*: Defaults to Array
155 def parse(source, opts = {})
> 156 Parser.new(source, opts).parse
157 end
158
159 # Parse the JSON document _source_ into a Ruby data structure and return it.
160 # The bang version of the parse method defaults to the more dangerous values
161 # for the _opts_ hash, so be sure only to parse trusted _source_ documents.
App backtrace
Full backtrace
- json (2.2.0) lib/json/common.rb:156:in `parse'
- activesupport (5.2.3) lib/active_support/json/decoding.rb:23:in `decode'
- actionpack (5.2.3) lib/action_dispatch/http/parameters.rb:12:in `block in module:Parameters'
- actionpack (5.2.3) lib/action_dispatch/http/parameters.rb:112:in `parse_formatted_parameters'
- actionpack (5.2.3) lib/action_dispatch/http/request.rb:381:in `block in POST'
- rack (2.0.7) lib/rack/request.rb:59:in `fetch_header'
- actionpack (5.2.3) lib/action_dispatch/http/request.rb:380:in `POST'
- actionpack (5.2.3) lib/action_dispatch/http/parameters.rb:55:in `parameters'
- actionpack (5.2.3) lib/action_controller/metal/params_wrapper.rb:290:in `_wrapper_enabled?'
- actionpack (5.2.3) lib/action_controller/metal/params_wrapper.rb:244:in `process_action'
- activerecord (5.2.3) lib/active_record/railties/controller_runtime.rb:24:in `process_action'
- actionpack (5.2.3) lib/abstract_controller/base.rb:134:in `process'
- actionview (5.2.3) lib/action_view/rendering.rb:32:in `process'
- actionpack (5.2.3) lib/action_controller/metal.rb:191:in `dispatch'
- actionpack (5.2.3) lib/action_controller/metal.rb:252:in `dispatch'
- actionpack (5.2.3) lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
- actionpack (5.2.3) lib/action_dispatch/routing/route_set.rb:34:in `serve'
- actionpack (5.2.3) lib/action_dispatch/routing/mapper.rb:18:in `block in class:Constraints'
- actionpack (5.2.3) lib/action_dispatch/routing/mapper.rb:48:in `serve'
- actionpack (5.2.3) lib/action_dispatch/journey/router.rb:52:in `block in serve'
- actionpack (5.2.3) lib/action_dispatch/journey/router.rb:35:in `serve'
- actionpack (5.2.3) lib/action_dispatch/routing/route_set.rb:840:in `call'
- bullet (6.0.0) lib/bullet/rack.rb:12:in `call'
- exception_notification (4.3.0) lib/exception_notification/rack.rb:41:in `call'
- mobvious (0.3.2) lib/mobvious/manager.rb:25:in `call'
- warden (1.2.8) lib/warden/manager.rb:36:in `block in call'
- warden (1.2.8) lib/warden/manager.rb:34:in `call'
- rack (2.0.7) lib/rack/tempfile_reaper.rb:15:in `call'
- rack (2.0.7) lib/rack/etag.rb:25:in `call'
- rack (2.0.7) lib/rack/conditional_get.rb:38:in `call'
- rack (2.0.7) lib/rack/head.rb:12:in `call'
- actionpack (5.2.3) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
- rack (2.0.7) lib/rack/session/abstract/id.rb:232:in `context'
- rack (2.0.7) lib/rack/session/abstract/id.rb:226:in `call'
- actionpack (5.2.3) lib/action_dispatch/middleware/cookies.rb:670:in `call'
- activerecord (5.2.3) lib/active_record/migration.rb:559:in `call'
- actionpack (5.2.3) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
- activesupport (5.2.3) lib/active_support/callbacks.rb:98:in `run_callbacks'
- actionpack (5.2.3) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
- actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call'
- better_errors (2.5.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
- better_errors (2.5.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
- better_errors (2.5.1) lib/better_errors/middleware.rb:57:in `call'
- actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
- actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
- railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app'
- railties (5.2.3) lib/rails/rack/logger.rb:28:in `call'
- sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
- actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
- actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call'
- rack (2.0.7) lib/rack/method_override.rb:22:in `call'
- rack (2.0.7) lib/rack/runtime.rb:22:in `call'
- activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
- actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call'
- actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call'
- rack (2.0.7) lib/rack/sendfile.rb:111:in `call'
- rack-cors (1.0.3) lib/rack/cors.rb:95:in `call'
- railties (5.2.3) lib/rails/engine.rb:524:in `call'
- railties (5.2.3) lib/rails/railtie.rb:190:in `method_missing'
- rack (2.0.7) lib/rack/urlmap.rb:68:in `block in call'
- rack (2.0.7) lib/rack/urlmap.rb:53:in `call'
- puma (3.12.1) lib/puma/configuration.rb:227:in `call'
- puma (3.12.1) lib/puma/server.rb:660:in `handle_request'
- puma (3.12.1) lib/puma/server.rb:474:in `process_client'
- puma (3.12.1) lib/puma/server.rb:334:in `block in run'
- puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread'