medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
25.93k stars 2.6k forks source link

TypeError: Cannot read properties of undefined (reading 'cache') #5606

Closed brunowego closed 4 months ago

brunowego commented 1 year ago

Bug report

Describe the bug

Currently with @medusajs/modules-sdk at version 1.12.3, I'm getting this error TypeError: Cannot read properties of undefined (reading 'cache').

Rolling back to version 1.12.2 works.

{
  "resolutions": {
    "@medusajs/modules-sdk": "1.12.2"
  }
}

System information

Medusa version (including plugins):

{
  "dependencies": {
    "@medusajs/admin": "~7.1.7",
    "@medusajs/cache-redis": "~1.9.0",
    "@medusajs/event-bus-redis": "~1.8.10",
    "@medusajs/file-local": "~1.0.2",
    "@medusajs/medusa": "~1.17.4",
    "medusa-fulfillment-manual": "~1.1.38",
    "medusa-payment-manual": "~1.0.24",
    "typeorm": "~0.3.17"
  }
}

Node.js version: v18.18.0 Database: PostgreSQL Operating system: Darwin

olivermrbl commented 1 year ago

Thanks for filing this issue. Can I get you to add reproducible steps? When are you experiencing this?

sankalpsingha commented 1 year ago

Seems like updating to "@medusajs/medusa": "1.17.4" solves the issue.

Nadeem34513 commented 1 year ago

same issue after updating to v1.17.4 rolling back to v1.17.3 didn't fix the error

ebdrup commented 1 year ago

I have the same issue, rolling back with a override as described by original poster doesn't work. The error happens when resolving the eventBusModuleService package.json:

  "dependencies": {
    "@medusajs/admin": "7.1.7",
    "@medusajs/cache-inmemory": "1.8.10",
    "@medusajs/cache-redis": "1.9.0",
    "@medusajs/event-bus-local": "1.9.7",
    "@medusajs/event-bus-redis": "1.8.10",
    "@medusajs/icons": "1.1.0",
    "@medusajs/medusa": "1.17.4",
    "@medusajs/medusa-cli": "1.3.21",
    "@medusajs/medusa-js": "6.1.4",
    "@medusajs/types": "1.11.6",
    "@medusajs/ui": "2.2.1",
    "@medusajs/utils": "1.10.5",
    "@sendgrid/mail": "7.7.0",
    "@slack/web-api": "6.10.0",
    "@tanstack/react-query": "4.22.0",
    "awilix": "9.0.0",
    "graphql": "16.8.1",
    "medusa-file-s3": "1.4.0",
    "medusa-fulfillment-manual": "1.1.38",
    "medusa-interfaces": "1.3.7",
    "medusa-payment-manual": "1.0.24",
    "medusa-payment-stripe": "6.0.6",
    "medusa-plugin-meilisearch": "2.0.10",
    "medusa-react": "9.0.11",
    "node-fetch": "2.7.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "typeorm": "0.3.17",
    "uuid": "^9.0.1",
    "zod": "3.22.4"
  },
Nadeem34513 commented 1 year ago

same issue after updating to v1.17.4 rolling back to v1.17.3 didn't fix the error

[FIXED] downgrade awilix pkg to v8.0.1 worked for me

vincent-yeo commented 11 months ago

The issue for me is after very extensive usage of backend development (refresh) it just suddenly appear. Tracking the debug terminal, it pointed towards Awilix/lib/container.js line 266.

This has been solved when Awilix package is rollback to v8.0.1  

sradevski commented 4 months ago

Hey, thanks for the report! Since v2 brought a lot of architectural and API changes on the backend, we will be closing this ticket since it no longer applies to our new setup, or the issue has already been fixed. If you are still facing issues with v1, please open a new ticket and we will address it as soon as possible. Thanks! 🙏