Open sadeghbarati opened 1 year ago
Same issue experienced by me in the unlazy
monorepo.
same ubuntu problem
Had the same problem in monorepo
import jiti from "file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/node_modules/.pnpm/jiti@1.21.0/node_modules/jiti/lib/index.js";
/* @type {import("C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/packages/ui/src/index")} / const _module = jiti(null, { "esmResolve": true, "interopDefault": true, "alias": { "@cd/ui": "C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/packages/ui" } })("C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/packages/ui/src/index.ts");
export const log = _module.log;
08:08:06 [vite] Pre-transform error: Failed to resolve import "file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/node_modules/.pnpm/jiti@1.21.0/node_modules/jiti/lib/index.js" from "../../packages/ui/dist/index.mjs". Does the file exist? 08:08:06 [vite] Internal server error: Failed to resolve import "file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/node_modules/.pnpm/jiti@1.21.0/node_modules/jiti/lib/index.js" from "../../packages/ui/dist/index.mjs". Does the file exist? Plugin: vite:import-analysis File: C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/packages/ui/dist/index.mjs:1:19 1 | import jiti from "file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/node_modules/.pnpm/jiti@1.21.0/node_modules/jiti/lib/index.js"; | ^ 2 | 3 | /* @type {import("C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/packages/ui/src/index")} / at formatError (file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/nodemodules/.pnpm/vite@5.2.11@types+node@20.12.11/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:50830:46) at TransformContext.error (file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/nodemodules/.pnpm/vite@5.2.11@types+node@20.12.11/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:50824:19) at normalizeUrl (file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/nodemodules/.pnpm/vite@5.2.11@types+node@20.12.11/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:66128:33) at async file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/nodemodules/.pnpm/vite@5.2.11@types+node@20.12.11/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:66283:47 at async Promise.all (index 0) at async TransformContext.transform (file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/nodemodules/.pnpm/vite@5.2.11@types+node@20.12.11/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:66204:13) at async Object.transform (file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/nodemodules/.pnpm/vite@5.2.11@types+node@20.12.11/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:51139:30) at async loadAndTransform (file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/nodemodules/.pnpm/vite@5.2.11@types+node@20.12.11/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:53894:29) at async viteTransformMiddleware (file:///C:/Users/Administrator/Desktop/dev/Turborepo/buildDemo/nodemodules/.pnpm/vite@5.2.11@types+node@20.12.11/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:63743:32)
Environment
Node: 18.15.0 Windows 11
Reproduction
https://github.com/sadeghbarati/jiti-resolve-issue
Describe the bug
Failed to resolve stub module in Windows and also macOS environment
Additional context
I'm using
unbuild --stub
to use jiti feature in Dev modeLogs
No response