Skip to content

Bug: Internal server error: Failed to resolve import "vite-plugin-node-polyfills/shims/process" #158

@Andrew-Chen-Wang

Description

@Andrew-Chen-Wang

Summary

I'm in a monorepo setup where I'm referencing another monorepo package from my vite/react app. I was looking forwards to the fix for #142, so I upgraded once #152 was merged and released in 0.27.0 and 0.28.0. With 0.27.0 and 0.28.0, I got this error. Downgrading to 0.26.0 fixed it.

5:18:15 AM [vite] Internal server error: Failed to resolve import "vite-plugin-node-polyfills/shims/process" from "../../../lib/typescript/api-client/src/index.ts". Does the file exist?
dashboard:dev:   Plugin: vite:import-analysis
dashboard:dev:   File: /Users/andrew/Work/Code/projects/matchpro/BestFit/lib/typescript/api-client/src/index.ts:1:36
dashboard:dev:   1  |  import { default as process } from "vite-plugin-node-polyfills/shims/process";
dashboard:dev:      |                                      ^
dashboard:dev:   2  |  import { client } from "./generated/client.gen";
dashboard:dev:   3  |  export * from "./generated/client.gen";
dashboard:dev:       at TransformPluginContext._formatLog (file:///Users/andrew/Work/Code/projects/matchpro/BestFit/node_modules/.pnpm/vite@8.0.8_@types+node@24.12.0_esbuild@0.28.0_jiti@2.6.1_terser@5.46.1_tsx@4.21.0/node_modules/vite/dist/node/chunks/node.js:30354:39)
dashboard:dev:       at TransformPluginContext.error (file:///Users/andrew/Work/Code/projects/matchpro/BestFit/node_modules/.pnpm/vite@8.0.8_@types+node@24.12.0_esbuild@0.28.0_jiti@2.6.1_terser@5.46.1_tsx@4.21.0/node_modules/vite/dist/node/chunks/node.js:30351:14)
dashboard:dev:       at normalizeUrl (file:///Users/andrew/Work/Code/projects/matchpro/BestFit/node_modules/.pnpm/vite@8.0.8_@types+node@24.12.0_esbuild@0.28.0_jiti@2.6.1_terser@5.46.1_tsx@4.21.0/node_modules/vite/dist/node/chunks/node.js:27633:18)
dashboard:dev:       at async file:///Users/andrew/Work/Code/projects/matchpro/BestFit/node_modules/.pnpm/vite@8.0.8_@types+node@24.12.0_esbuild@0.28.0_jiti@2.6.1_terser@5.46.1_tsx@4.21.0/node_modules/vite/dist/node/chunks/node.js:27696:30
dashboard:dev:       at async Promise.all (index 0)
dashboard:dev:       at async TransformPluginContext.transform (file:///Users/andrew/Work/Code/projects/matchpro/BestFit/node_modules/.pnpm/vite@8.0.8_@types+node@24.12.0_esbuild@0.28.0_jiti@2.6.1_terser@5.46.1_tsx@4.21.0/node_modules/vite/dist/node/chunks/node.js:27664:4)
dashboard:dev:       at async EnvironmentPluginContainer.transform (file:///Users/andrew/Work/Code/projects/matchpro/BestFit/node_modules/.pnpm/vite@8.0.8_@types+node@24.12.0_esbuild@0.28.0_jiti@2.6.1_terser@5.46.1_tsx@4.21.0/node_modules/vite/dist/node/chunks/node.js:30143:14)
dashboard:dev:       at async loadAndTransform (file:///Users/andrew/Work/Code/projects/matchpro/BestFit/node_modules/.pnpm/vite@8.0.8_@types+node@24.12.0_esbuild@0.28.0_jiti@2.6.1_terser@5.46.1_tsx@4.21.0/node_modules/vite/dist/node/chunks/node.js:24468:26)
dashboard:dev: 5:18:15 AM [vite] (client) Pre-transform error: Failed to resolve import "vite-plugin-node-polyfills/shims/process" from "../../../lib/typescript/api-client/src/index.ts". Does the file exist?
dashboard:dev:   Plugin: vite:import-analysis
dashboard:dev:   File: /Users/andrew/Work/Code/projects/matchpro/BestFit/lib/typescript/api-client/src/index.ts:1:36
dashboard:dev:   1  |  import { default as process } from "vite-plugin-node-polyfills/shims/process";
dashboard:dev:      |                                      ^                                                                                     
dashboard:dev:   2  |  import { client } from "./generated/client.gen";
dashboard:dev:   3  |  export * from "./generated/client.gen";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions