hello, could you share the solution again? I enter discord but it doesn’t come out.
Thank you so much
Topic summary
Issue: Developers encountered a TypeError: Cannot read properties of undefined (reading 'MongoDBSessionStorage') when configuring MongoDB session storage for Shopify apps.
Root Cause: The error stems from an incorrect import path in the Shopify API library. Users were attempting to access Shopify.Auth.Session.MongoDBSessionStorage, which doesn’t exist in certain library versions.
Solution: Remove Auth from the path:
- Incorrect:
Shopify.Auth.Session.MongoDBSessionStorage - Correct:
Shopify.Session.MongoDBSessionStorage
Additional Context:
- The solution was originally shared on Discord by another developer
- Shopify’s JS library has undergone significant changes; newer versions use a different package structure (see
@shopify/shopify-app-session-storage-mongodb) - Multiple users confirmed this fix resolved their connection issues
- The error occurred even with verified MongoDB credentials that worked outside the Shopify context
1 Like