spree-product-assembly icon indicating copy to clipboard operation
spree-product-assembly copied to clipboard

AssemblyShipmentSerializer super class mismatch issue

Open RhysStansfield opened this issue 11 years ago • 6 comments

Running into a slightly annoying issue (2-3-stable) whereby the Spree::Wombat::AssemblyShipmentSerializer is regularly throwing a superclass mismatch error after changes are made in our app in development mode - issue comes from this line of code:

https://github.com/spree/spree-product-assembly/blob/2-3-stable/lib/spree_product_assembly/engine.rb#L14

Changing it to simply require it fixes the problem - I assume there was a reason to be load-ing it though in the first place, testing or some-such?

I also note that in the current master version of this Gem you've removed it entirely (not an option for us at the moment unfortunately as we can't move up to master spree without doing some serious hackery).

Long story short - can I open a PR removing that load jazz from 2-3-stable or will it cause devastation in ways I've not considered? Or other options/ideas?

Cheers!

Rhys

RhysStansfield avatar Sep 04 '14 12:09 RhysStansfield

What is the error message & backtrace? This sounds like another Spring error... not an error with that code. You could try removing spring from your application to fix dev environment, but most people are just restarting server if it begins to act up until we figure out what the root cause is.

I'm not sure what the root cause is yet, but we have been seeing all sorts of weird errors as a result of Rails 4.1 using spring to autoload code in development now. For instance: https://github.com/spree/spree/issues/5104 https://github.com/jumph4x/durable_decorator/issues/24

JDutil avatar Sep 04 '14 20:09 JDutil

I'm not sure why this is happenning either, and I'm sorry I can't come up with a reasonable explanation, but... It doesn't seem to me like it's (exclusively) related to Spring, as we are not even running it.

$ spring status Spring is not running.

There's also a comment on the spree issue that you linked from a guy who is not using Spring either, but Zeus. In our case, we're using Spork.

forvalho avatar Sep 05 '14 08:09 forvalho

Can you guys provide the error message & backtrace?

JDutil avatar Sep 05 '14 16:09 JDutil

Sorry, it took a while to happen again, but here it is:

TypeError - superclass mismatch for class AssemblyShipmentSerializer:
   () Users/francisco/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/spree-product-assembly-3cb32c61c44f/lib/serializers/spree/wombat/assembly_shipment_serializer.rb:3:in `<module:Wombat>'
   () Users/francisco/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/spree-product-assembly-3cb32c61c44f/lib/serializers/spree/wombat/assembly_shipment_serializer.rb:2:in `<module:Spree>'
   () Users/francisco/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/spree-product-assembly-3cb32c61c44f/lib/serializers/spree/wombat/assembly_shipment_serializer.rb:1:in `<top (required)>'
  activesupport (4.1.5) lib/active_support/dependencies.rb:241:in `block in load'
  activesupport (4.1.5) lib/active_support/dependencies.rb:232:in `load_dependency'
  activesupport (4.1.5) lib/active_support/dependencies.rb:241:in `load'
   () Users/francisco/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/spree-product-assembly-3cb32c61c44f/lib/spree_product_assembly/engine.rb:14:in `block in activate'
   () Users/francisco/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/spree-product-assembly-3cb32c61c44f/lib/spree_product_assembly/engine.rb:13:in `activate'
  activesupport (4.1.5) lib/active_support/callbacks.rb:438:in `block in make_lambda'
  activesupport (4.1.5) lib/active_support/callbacks.rb:184:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:185:in `block in simple'
  activesupport (4.1.5) lib/active_support/callbacks.rb:86:in `run_callbacks'
  actionpack (4.1.5) lib/action_dispatch/middleware/reloader.rb:83:in `prepare!'
  actionpack (4.1.5) lib/action_dispatch/middleware/reloader.rb:71:in `call'
  actionpack (4.1.5) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:56:in `call'
  rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
  meta_request (0.3.4) lib/meta_request/middlewares/headers.rb:16:in `call'
  actionpack (4.1.5) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.1.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.5) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.5) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.5) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.5) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.5) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.5) lib/rails/rack/logger.rb:20:in `call'
  quiet_assets (1.0.3) lib/quiet_assets.rb:23:in `call_with_quiet_assets'
  actionpack (4.1.5) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.1.5) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.1.5) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.5) lib/rails/engine.rb:514:in `call'
  railties (4.1.5) lib/rails/application.rb:144:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
  /Users/francisco/.rbenv/versions/2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
  /Users/francisco/.rbenv/versions/2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
  /Users/francisco/.rbenv/versions/2.1.1/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

forvalho avatar Sep 06 '14 11:09 forvalho

I'm getting exactly the same issue. Any movement on this issue?

realadeel avatar Jan 26 '15 19:01 realadeel

Same error here.

zavan avatar May 04 '17 02:05 zavan