You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug Report Describe the Bug
I am encountering an issue with MedusaJS when executing requests on NextJS Edge runtime. The bug seems to be associated with Axios, displaying the error: 'Unhandled Runtime Error: adapter is not a function.'
Steps to Reproduce the Behavior
Initialize a Next.js project.
Install medusajs and medusa-react.
Initialize an instance of a MedusaJS client.
Switch Page runtime to edge
Attempt to fetch data using a method such as medusaClient.products.list().
Expected Behavior
The expectation is to successfully fetch data in the same manner as when using a Node.js runtime environment.
**What**
- Adds the ability to pass an Axios adapter through the client's config.
**Why**
- When using NextJS with the edge runtime for deployment on Cloudflare Pages, for example, Axios does not work. Therefore, it is necessary to pass an adapter like [@vespaiach/axios-fetch-adapter](https://github.com/vespaiach/axios-fetch-adapter).
**How**
- Receives the **axiosAdapter** in the config and implements it when creating the **axiosClient**.
Closes#6133
Bug Report
Describe the Bug
I am encountering an issue with MedusaJS when executing requests on NextJS Edge runtime. The bug seems to be associated with Axios, displaying the error: 'Unhandled Runtime Error: adapter is not a function.'
System Information
Medusa Version: "@medusajs/medusa-js": "^6.1.5", "medusa-react": "^9.0.13"
Node.js Version: [Not relevant]
Database: [Not relevant]
Operating System: [Not relevant]
Browser: [Not relevant]
Steps to Reproduce the Behavior
Initialize a Next.js project.
Install medusajs and medusa-react.
Initialize an instance of a MedusaJS client.
Switch Page runtime to edge
Attempt to fetch data using a method such as medusaClient.products.list().
Expected Behavior
The expectation is to successfully fetch data in the same manner as when using a Node.js runtime environment.
Screenshots
yarn run dev
yarn build
yarn start
Code Snippets
A minimal repository reproducing the bug can be found here: MedusaJS Minimal Bug Reproduction
The text was updated successfully, but these errors were encountered: