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

fix: environment variables not detected #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HundredBeans
Copy link

Hi, I came across this issue/error when running the npm run seed command.

Initializing pluginsTypeError: Expected parameter accessToken at createCMAHttpClient (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/medusa-plugin-contentful/node_modules/contentful-management/dist/contentful-management.node.js:7479:11) at createClient (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/medusa-plugin-contentful/node_modules/contentful-management/dist/contentful-management.node.js:7424:99) at new ContentfulService (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/medusa-plugin-contentful/services/contentful.js:80:64) at /Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/@medusajs/medusa/dist/loaders/plugins.js:377:112 at Object.resolve (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/awilix/lib/resolvers.js:295:20) at resolve (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/awilix/lib/container.js:250:41) at Object.get (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/awilix/lib/container.js:67:32) at new ContentfulSubscriber (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/medusa-plugin-contentful/subscribers/contentful.js:23:32) at /Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/@medusajs/medusa/dist/loaders/plugins.js:405:77 at Object.resolve (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/awilix/lib/resolvers.js:295:20) at Object.build (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/awilix/lib/container.js:313:37) at /Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/@medusajs/medusa/dist/loaders/plugins.js:405:19 at Array.forEach (<anonymous>) at registerSubscribers (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/@medusajs/medusa/dist/loaders/plugins.js:403:11) at /Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/@medusajs/medusa/dist/loaders/plugins.js:92:41 at step (/Users/mohammaddaffa/Documents/Projects/workshop/medusa/medusa-contentful/backend/node_modules/@medusajs/medusa/dist/loaders/plugins.js:33:23)

It looks like this was caused by the Environment Variables are not detected in the medusa-config.js file. To fix that, I added dotenv inside the file. Hope it is helpful. Thanks

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

Successfully merging this pull request may close these issues.

1 participant