Server functions using vite-plugin-node-polyfills's shim for 'process' instead of 'node:process'

https://gist.github.com/ivanfeli/20114db6202124265bc9f49100b88b7e

Extract from the built file (.output/server/chunks/_/__root-BdAHKAt1.mjs):
import process from 'vite-plugin-node-polyfills/shims/process';
...
const fnEnv = createServerFn().handler(fnEnv_createServerFn_handler, (ctx) => {
  return process.env;
});


Relevant code:
export const fnEnv = createServerFn().handler((ctx) => {
  return process.env
})

export const Route = createRootRoute({
  component: RootLayout,
  beforeLoad: async () => {
    console.log(await fnEnv())
  },
})
Gist
TanStack Start server function polyfill issue. GitHub Gist: instantly share code, notes, and snippets.
TanStack Start server function polyfill issue
Was this page helpful?