fix(js-sdk,admin-bundler): Fix qs import (#11172)
This commit is contained in:
1 parent
ea402875a5
commit
65d8d6dc0e
3 files changed
+9
-2
No files matched your search
@@ -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",
|
"react-router-dom",
|
||||||
"@medusajs/ui",
|
"@medusajs/ui",
|
||||||
"@medusajs/dashboard",
|
"@medusajs/dashboard",
|
||||||
|
"@medusajs/js-sdk",
|
||||||
"@tanstack/react-query",
|
"@tanstack/react-query",
|
||||||
],
|
],
|
||||||
exclude: [...VIRTUAL_MODULES],
|
exclude: [...VIRTUAL_MODULES],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { events } from "fetch-event-stream"
|
import { events } from "fetch-event-stream"
|
||||||
import qs from "qs"
|
import { stringify } from "qs"
|
||||||
import {
|
import {
|
||||||
ClientFetch,
|
ClientFetch,
|
||||||
Config,
|
Config,
|
||||||
@@ -242,7 +242,7 @@ export class Client {
|
|||||||
const params = Object.fromEntries(
|
const params = Object.fromEntries(
|
||||||
normalizedInput.searchParams.entries()
|
normalizedInput.searchParams.entries()
|
||||||
)
|
)
|
||||||
const stringifiedQuery = qs.stringify({ ...params, ...init.query })
|
const stringifiedQuery = stringify({ ...params, ...init.query })
|
||||||
normalizedInput.search = stringifiedQuery
|
normalizedInput.search = stringifiedQuery
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user