fix(js-sdk,admin-bundler): Fix qs import (#11172)
This commit is contained in:
committed by
GitHub
parent
ea402875a5
commit
65d8d6dc0e
6
.changeset/nasty-parrots-push.md
Normal file
6
.changeset/nasty-parrots-push.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/admin-bundler": patch
|
||||
"@medusajs/js-sdk": patch
|
||||
---
|
||||
|
||||
fix(js-sdk,admin-bundler): Import resolve from qs in a way that works in both ESM and CJS projects, and add @medusajs/js-sdk to optimized deps
|
||||
@@ -34,6 +34,7 @@ export async function getViteConfig(
|
||||
"react-router-dom",
|
||||
"@medusajs/ui",
|
||||
"@medusajs/dashboard",
|
||||
"@medusajs/js-sdk",
|
||||
"@tanstack/react-query",
|
||||
],
|
||||
exclude: [...VIRTUAL_MODULES],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { events } from "fetch-event-stream"
|
||||
import qs from "qs"
|
||||
import { stringify } from "qs"
|
||||
import {
|
||||
ClientFetch,
|
||||
Config,
|
||||
@@ -242,7 +242,7 @@ export class Client {
|
||||
const params = Object.fromEntries(
|
||||
normalizedInput.searchParams.entries()
|
||||
)
|
||||
const stringifiedQuery = qs.stringify({ ...params, ...init.query })
|
||||
const stringifiedQuery = stringify({ ...params, ...init.query })
|
||||
normalizedInput.search = stringifiedQuery
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user