diff --git a/.changeset/big-cars-raise.md b/.changeset/big-cars-raise.md new file mode 100644 index 0000000000..50e416049f --- /dev/null +++ b/.changeset/big-cars-raise.md @@ -0,0 +1,7 @@ +--- +"@blitzjs/next": patch +"@blitzjs/rpc": patch +"blitz": patch +--- + +fix export `enhancePrisma` in client diff --git a/packages/blitz-next/scripts/postinstall.js b/packages/blitz-next/scripts/postinstall.js index 3f12289d2c..2659e84b82 100644 --- a/packages/blitz-next/scripts/postinstall.js +++ b/packages/blitz-next/scripts/postinstall.js @@ -170,6 +170,7 @@ function codegen() { const defaultIndexJsPath = path.join(dotBlitzDir, "index.js") const defaultIndexBrowserJSPath = path.join(dotBlitzDir, "index-browser.js") const defaultIndexDTSPath = path.join(dotBlitzDir, "index.d.ts") + const emptyJSPath = path.join(dotBlitzDir, "turbopack-empty.js") if (!fs.existsSync(defaultIndexJsPath)) { await copyFile(path.join(__dirname, "default-index.js"), defaultIndexJsPath) @@ -181,6 +182,10 @@ function codegen() { if (!fs.existsSync(defaultIndexDTSPath)) { await copyFile(path.join(__dirname, "default-index.d.ts"), defaultIndexDTSPath) } + + if (!fs.existsSync(emptyJSPath)) { + await copyFile(path.join(__dirname, "turbopack-empty.js"), emptyJSPath) + } } catch (e) { console.error(e) } diff --git a/packages/blitz-next/scripts/turbopack-empty.js b/packages/blitz-next/scripts/turbopack-empty.js new file mode 100644 index 0000000000..336ce12bb9 --- /dev/null +++ b/packages/blitz-next/scripts/turbopack-empty.js @@ -0,0 +1 @@ +export {} diff --git a/packages/blitz-rpc/src/index-server.ts b/packages/blitz-rpc/src/index-server.ts index e09e8e991b..3412ef5416 100644 --- a/packages/blitz-rpc/src/index-server.ts +++ b/packages/blitz-rpc/src/index-server.ts @@ -160,9 +160,10 @@ export function installWebpackConfig({ export function installTurboConfig() { return { resolveAlias: { - "cross-spawn": {browser: "./turbopack/empty.js"}, - "npm-which": {browser: "./turbopack/empty.js"}, - fs: {browser: "./turbopack/empty.js"}, + "cross-spawn": {browser: ".blitz/turbopack-empty.js"}, + "npm-which": {browser: ".blitz/turbopack-empty.js"}, + fs: {browser: ".blitz/turbopack-empty.js"}, + child_process: {browser: ".blitz/turbopack-empty.js"}, }, rules: { "**/*...blitz*.{jsx,tsx,js,ts}": { diff --git a/packages/blitz/src/index-browser.tsx b/packages/blitz/src/index-browser.tsx index 2213e3ae00..6037d5e6fc 100644 --- a/packages/blitz/src/index-browser.tsx +++ b/packages/blitz/src/index-browser.tsx @@ -19,6 +19,7 @@ export { RedirectError, OAuthError, } +export * from "./utils/enhance-prisma" export type BlitzProviderComponentType = ( component: ComponentType, diff --git a/packages/blitz/src/index-server.ts b/packages/blitz/src/index-server.ts index 5f2d2af110..1f4db65750 100644 --- a/packages/blitz/src/index-server.ts +++ b/packages/blitz/src/index-server.ts @@ -13,7 +13,6 @@ export {reduceBlitzServerPlugins} from "./plugin" export {findNodeModulesRoot, findNodeModulesRootSync} from "./cli/utils/find-node-modules" export {startWatcher, stopWatcher} from "./cli/utils/routes-manifest" -export * from "./utils/enhance-prisma" export interface MiddlewareResponse extends ServerResponse { blitzCtx: C