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

Issue with Editing Pricelists after latest medusa update (core & admin) #5348

Closed
brendansimcox opened this issue Oct 11, 2023 · 17 comments · Fixed by #5535
Closed

Issue with Editing Pricelists after latest medusa update (core & admin) #5348

brendansimcox opened this issue Oct 11, 2023 · 17 comments · Fixed by #5535

Comments

@brendansimcox
Copy link

brendansimcox commented Oct 11, 2023

Issue Summary

We have upgraded our staging environment as a pre-release test before deploying to production but found that the edit price list functionality isn't working

All packages are updated to the latest and manually added medusa-react to the latest as a dependency, running node 16, but getting this issue

Unexpected Application Error!
(0 , en.useAdminDeletePriceListProductsPrices) is not a function
TypeError: (0 , en.useAdminDeletePriceListProductsPrices) is not a function
    at Os (https://ommitedurl/app/918.af1075aa.chunk.js:1:1253518)
    at oO (https://ommitedurl/app/main.1be561c0.js:18:60913)
    at u (https://ommitedurl/app/main.1be561c0.js:18:119434)
    at sI (https://ommitedurl/app/main.1be561c0.js:18:99087)
    at https://ommitedurl/app/main.1be561c0.js:18:98954
    at sN (https://ommitedurl/app/main.1be561c0.js:18:98961)
    at sP (https://ommitedurl/app/main.1be561c0.js:18:95713)
    at s_ (https://ommitedurl/app/main.1be561c0.js:18:96102)
    at n6 (https://ommitedurl/app/main.1be561c0.js:18:44823)
    at https://ommitedurl/app/main.1be561c0.js:18:93613

Steps to reproduce

  1. upgrade all packages to latest medusa (medusa, medusa-admin and all supporting packages)
  2. go to prices lists
  3. select a price list to edit
  4. error shows

package.json

"dependencies": {
    "@medusajs/admin": "^7.1.4",
    "@medusajs/cache-redis": "1.8.8",
    "@medusajs/event-bus-redis": "1.8.8",
    "@medusajs/inventory": "^1.9.1",
    "@medusajs/medusa": "^1.17.1",
    "@medusajs/medusa-cli": "^1.3.21",
    "@medusajs/medusa-oas-cli": "0.2.20-snapshot-20230921172817",
    "@medusajs/types": "^1.11.2",
    "@medusajs/utils": "^1.10.3",
    "@medusajs/workflows": "^0.2.3",
    "@radix-ui/react-dialog": "^1.0.5",
    "@tanstack/react-query": "^4.36.1",
    "medusa-extender": "^1.8.8",
    "medusa-file-s3": "^1.3.1",
    "medusa-fulfillment-manual": "^1.1.38",
    "medusa-interfaces": "^1.3.7",
    "medusa-payment-manual": "^1.0.24",
    "medusa-payment-paypal": "^6.0.2",
    "medusa-payment-stripe": "^6.0.4",
    "medusa-plugin-meilisearch": "^2.0.8",
    "medusa-plugin-sendgrid": "^1.3.11",
    "medusa-plugin-ses": "^2.0.17",
    "medusa-plugin-wishlist": "^1.1.43",
    "medusa-react": "^9.0.7",
    "typeorm": "^0.3.17",
    "yarn": "^1.22.19"
  },
  "repository": "https://github.com/medusajs/medusa-starter-default.git",
  "keywords": [
    "sqlite",
    "ecommerce",
    "headless",
    "medusa"
  ],
  "devDependencies": {
    "@babel/cli": "^7.22.5",
    "@babel/core": "^7.22.5",
    "@babel/preset-typescript": "^7.22.5",
    "babel-preset-medusa-package": "^1.1.19",
    "nodemon": "^2.0.22",
    "patch-package": "^8.0.0",
    "postinstall-postinstall": "^2.1.0",
    "typescript": "^5.1.6"
  }
@milan-zami-tech
Copy link

After updating the project, I had a problem viewing Pricing in the admin panel. It didn't show at all. Fixed it by deleting .cache folder. Hope this helps.

@olivermrbl
Copy link
Contributor

@brendansimcox – can you successfully run the project locally? If so, this could indicate that there's an issue with your lock-file.

@brendansimcox
Copy link
Author

@olivermrbl will attempt running it locally tomorrow morning and try with a fresh lock file, see if that makes any difference and then report back., ty

@brendansimcox
Copy link
Author

@olivermrbl removed the lock file and reinstalled on development environment which was successful, but now we're finding a secondary issue, the edit price list loads - but the request to the products within the pricelist times out, which seems to be crashing the medusa service - resulting in us needing to restart the service.

This is the request url:

/admin/price-lists/pl_01H93E3WTH55PKX9D2DZH9DJ4B/products?limit=10&offset=0&expand=variants%2Ccollection

Screenshot of time out below.

image

The only thing different in my package.json from above is

"@medusajs/medusa-oas-cli": "0.2.20-snapshot-20230921172817" < Removed

@brendansimcox
Copy link
Author

@olivermrbl hey buddy - do you happen to know if this is something you've been able to reproduce?

@olivermrbl
Copy link
Contributor

@brendansimcox, sorry for the slow follow-up. Did you manage to solve your issue?

@brendansimcox
Copy link
Author

brendansimcox commented Oct 31, 2023 via email

@brendansimcox
Copy link
Author

@olivermrbl I think i've found the issue - when opening the price list base page, there seems to be a network request to /admin/products with a limit=0, in our case we have approx 18,000 products and its timing out the server whilst it prepares the response, which is roughly 32mb (and 40-50seconds)

image

@brendansimcox
Copy link
Author

@olivermrbl this seems to be across 1.17.1 / 2 / 3 from what I can see, currently can't see the root of the issue, we're scouring through admin-ui package atm - seems to be triggered the first time you visit /a/pricing - looks to be trying to preload the full price list.

@olivermrbl
Copy link
Contributor

Thanks for sharing @brendansimcox. @kasperkristensen could you investigate this?

@brendansimcox
Copy link
Author

@kasperkristensen would it be possible to get a snapshot that we can install when this is approved?

@brendansimcox
Copy link
Author

hey @olivermrbl @kasperkristensen just tested this locally with yarn medusa develop and the snapshots and still getting the network request with limit=0

@olivermrbl
Copy link
Contributor

@brendansimcox, you'll need an admin snapshot. I'll publish one for you now :)

@brendansimcox
Copy link
Author

thatnks @olivermrbl

@olivermrbl
Copy link
Contributor

Try this one:

@medusajs/admin@7.1.7-next-20231102164835

@brendansimcox
Copy link
Author

thanks @olivermrbl trying now

@brendansimcox
Copy link
Author

all sorted, thank you both; @olivermrbl @kasperkristensen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants