Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API calls fail on Solidus engines mounted with namespace #2700

Open
davideghz opened this issue Apr 16, 2018 · 3 comments
Open

API calls fail on Solidus engines mounted with namespace #2700

davideghz opened this issue Apr 16, 2018 · 3 comments
Labels
changelog:solidus_api Changes to the solidus_api gem type:bug Error, flaw or fault

Comments

@davideghz
Copy link

davideghz commented Apr 16, 2018

Steps to reproduce

  • mount Solidus at a custom path, like mount Spree::Core::Engine, at: '/store/'
  • open browser at /store/orders/[:order_number]/cart page
  • check JS console for errors

Expected behavior

I should be able to add product variants to order

Actual behavior

In JS console I see a failing call to http:https://localhost:3000/api/orders/[:order_number] and "Add Item" button is disabled

System configuration

Solidus Version: ~> 2.5

note: I see this behavior only in my local environment, not in production
note 2: all the API calls are broken, not only /api/orders

@davideghz
Copy link
Author

davideghz commented Apr 16, 2018

I just noticed that

Spree.mountedAt = function() {
return "<%= Rails.application.routes.url_helpers.spree_path(trailing_slash: true) %>";
};

is evaluated as

Spree.mountedAt = function() {
  return "/";
};

while in my rails console I get

2.4.2 :001 > Rails.application.routes.url_helpers.spree_path(trailing_slash: true)
 => "/store/" 

not sure how to proceed from here tho

@jordan81
Copy link

jordan81 commented Sep 6, 2018

I'm running into I think the same issue with mounting not engine not at the root. Viewing and Creating new Taxons is not working when changing mounting location from '/'. 404 errors show file not found for "/api/taxononomies/" when mounting point is /store/ using the "Add Taxon" Button.

@jacobherrington jacobherrington added the changelog:solidus_api Changes to the solidus_api gem label Nov 21, 2018
@readysetawesome
Copy link

readysetawesome commented Jul 23, 2020

I think I'm running into the same issue. basically mount with 'at' doesn't work for me at all, all product page links are broken as soon as I mount at something other than the root path. I don't understand why some links are working (i.e. admin sections) but the store itself is totally broken with incorrect product links.

-edit-
Problem solved - Rails.cache.clear

@waiting-for-dev waiting-for-dev added the type:bug Error, flaw or fault label Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_api Changes to the solidus_api gem type:bug Error, flaw or fault
Projects
None yet
Development

No branches or pull requests

5 participants