boomerdigital / spree_avatax_certified

Improve your Spree store's sales tax decision automation with Avalara AvaTax
Other
12 stars 42 forks source link

TypeError: superclass mismatch for class ReturnTax #119

Closed dawidof closed 7 years ago

dawidof commented 7 years ago
Running via Spring preloader in process 31
Loading development environment (Rails 4.2.9)
irb: warn: can't alias context from irb_context.
irb(main):001:0> reload!
Reloading...
TypeError: superclass mismatch for class ReturnTax
    from /bundle/bundler/gems/spree_avatax_certified-f3cf18ee4928/app/models/spree_avatax_certified/request/return_tax.rb:3:in `<module:Request>'
    from /bundle/bundler/gems/spree_avatax_certified-f3cf18ee4928/app/models/spree_avatax_certified/request/return_tax.rb:2:in `<module:SpreeAvataxCertified>'
    from /bundle/bundler/gems/spree_avatax_certified-f3cf18ee4928/app/models/spree_avatax_certified/request/return_tax.rb:1:in `<top (required)>'
    from /bundle/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `load'
    from /bundle/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `block in load'
    from /bundle/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /bundle/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `load'
    from /bundle/bundler/gems/spree_avatax_certified-f3cf18ee4928/lib/spree_avatax_certified/engine.rb:39:in `block in activate'
    from /bundle/bundler/gems/spree_avatax_certified-f3cf18ee4928/lib/spree_avatax_certified/engine.rb:38:in `glob'
    from /bundle/bundler/gems/spree_avatax_certified-f3cf18ee4928/lib/spree_avatax_certified/engine.rb:38:in `activate'
    from /bundle/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:446:in `instance_exec'
    from /bundle/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:446:in `block in make_lambda'
    from /bundle/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:192:in `block in simple'
    from /bundle/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:504:in `block in call'
    from /bundle/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:504:in `each'
dawidof commented 7 years ago

Also sometimes get the same error on frontend

dhonig commented 7 years ago

Can you let us know what Spree version your using?

dawidof commented 7 years ago

@dhonig 3.1.5

dhonig commented 7 years ago

Thanks we've tested this against a vanilla install of 3.1.5 as recently as last week. Can you outline steps to reproduce?

dawidof commented 7 years ago

We've got a huge project on spree.

  1. made all from Installation section in Readme
  2. Set up all credentials.
  3. Set up shipping methods

Tested on 3 computers with the same environment. The same error.

In console, the error appears after reload! In browser, at first, it works normally, but after few minutes appears an error. It is hard to find out what is the reason.

I thought that the reason is in https://github.com/boomerdigital/spree_avatax_certified/blob/master/lib/spree_avatax_certified/engine.rb#L39. Changed cache_classes to true, this error gone, but started to appear random strange errors.

dhonig commented 7 years ago

Thank you. Very helpful. Give us some time to clear our plates and look into this.

oskaror commented 7 years ago

120 fixed the problem