{"record":{"id":"23e7c9447b426919","repo":"medusajs/medusa","slug":"unable-to-retrieve-the-fulfillment-provider-with-i-23e7c9","errorCode":null,"errorMessage":"Unable to retrieve the fulfillment provider with id: ${providerId}, the following error occurred: ${err.message}","messagePattern":"Unable to retrieve the fulfillment provider with id: (.+?), the following error occurred: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/modules/fulfillment/src/services/fulfillment-provider.ts","lineNumber":79,"sourceCode":"  ): FulfillmentTypes.IFulfillmentProvider {\n    try {\n      return this.__container__[`fp_${providerId}`]\n    } catch (err) {\n      if (err.name === \"AwilixResolutionError\") {\n        const errMessage = `\nUnable to retrieve the fulfillment provider with id: ${providerId}\nPlease make sure that the provider is registered in the container and it is configured correctly in your project configuration file.`\n\n        // Log full error for debugging\n        this.#logger.error(`AwilixResolutionError: ${err.message}`, err)\n\n        throw new Error(errMessage)\n      }\n\n      const errMessage = `Unable to retrieve the fulfillment provider with id: ${providerId}, the following error occurred: ${err.message}`\n      this.#logger.error(errMessage)\n\n      throw new Error(errMessage)\n    }\n  }\n\n  async listFulfillmentOptions(providerIds: string[]): Promise<any[]> {\n    return await promiseAll(\n      providerIds.map(async (p) => {\n        const provider = this.retrieveProviderRegistration(p)\n        return {\n          provider_id: p,\n          options: (await provider.getFulfillmentOptions()) as Record<\n            string,\n            unknown\n          >[],\n        }\n      })\n    )\n  }\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/fulfillment/src/services/fulfillment-provider.ts#L61-L97","documentation":"Generic wrapper thrown when resolving a fulfillment provider from the container fails with a non-registration error (any exception other than AwilixResolutionError). The original error message is included and logged; the cause is inside the provider module or its initialization.","triggerScenarios":"A provider plugin throws during module evaluation/import (syntax error, missing dependency) or its container activation fails while retrieving it for a shipping option.","commonSituations":"Broken provider build output, missing peer dependency in the provider package, or a runtime error in the provider constructor.","solutions":["Read the appended err.message and the server log line — it names the true cause","Fix the provider code/dependency issue it indicates","Rebuild/reinstall the provider package and restart"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { const provider = await fulfillmentProviderService.retrieveProviderRegistration(id) } catch (e) { logger.error(e.message); // message embeds the root cause — act on it throw e }","preventionTips":["Add tests that import each provider module to catch evaluation errors early","Keep provider dependency versions in sync with the host app"],"tags":["fulfillment","provider","container","initialization"],"backgroundTag":"provider-initialization-failed","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}