bluwy/create-vite-extra

Vite Deno templates do not work

OkGameStudios opened this issue · 7 comments

When i try to create a deno + framework template it gives me this error when running the app.
image
I originally wanted to try react but after it not working i tried it for svelte too with the same error. Please tell me how to fix it and correct the issue.

deno: 1.33.1
node: 16.14.2
Os: Windows 10

This is the whole console in text
Task dev deno run -A --node-modules-dir npm:vite failed to load config from C:\Users\HP\Desktop\deno\svelte-test\vite.config.mjs error when starting dev server: TypeError: Could not resolve 'esbuild' from 'file:///C:/Users/HP/Desktop/deno/svelte-test/node_modules/.deno/@sveltejs+vite-plugin-svelte@2.1.1/node_modules/vite/dist/node/index.js'. Caused by: could not find package 'esbuild' from referrer 'file:///C:/Users/HP/Desktop/deno/svelte-test/node_modules/.deno/@sveltejs+vite-plugin-svelte@2.1.1/node_modules/vite/dist/node/index.js'. at async loadConfigFromBundledFile (file:///C:/Users/HP/Desktop/deno/svelte-test/node_modules/.deno/vite@4.3.3/node_modules/vite/dist/node/chunks/dep-a178814b.js:64414:21) at async loadConfigFromFile (file:///C:/Users/HP/Desktop/deno/svelte-test/node_modules/.deno/vite@4.3.3/node_modules/vite/dist/node/chunks/dep-a178814b.js:64296:28) at async resolveConfig (file:///C:/Users/HP/Desktop/deno/svelte-test/node_modules/.deno/vite@4.3.3/node_modules/vite/dist/node/chunks/dep-a178814b.js:63904:28) at async _createServer (file:///C:/Users/HP/Desktop/deno/svelte-test/node_modules/.deno/vite@4.3.3/node_modules/vite/dist/node/chunks/dep-a178814b.js:63190:20) at async CAC.<anonymous> (file:///C:/Users/HP/Desktop/deno/svelte-test/node_modules/.deno/vite@4.3.3/node_modules/vite/dist/node/cli.js:733:24)

bluwy commented

Hmm I also got that on deno 1.33.1 macos. Downgrading to 1.32.0 works, and I see 1.33.0 has stricter hoisting in node_modules that seems to be causing the issue. I wonder if it's similar to denoland/deno#18924. cc @bartlomieju

Thanks for the ping. I will look into this issue ASAP.

Opened a PR that fixes the problem. This fix will be released in Deno v1.32.2 later this week. Thanks for the report!

👋

Not sure if this should be a new issue or not since I initially ran into this issue but it has since morphed into a similar issue from #9, in any case, since this is still Vite/Deno related presumably figured I'd start here :

Upgrade to Deno resolved the esbuild error, but now I'm getting the following when I run deno task dev

error: Uncaught Error: EINVAL: invalid argument, stat
    at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:89:11)
    at __node_internal_uvException (ext:deno_node/internal/errors.ts:182:12)
    at denoErrorToNodeError (ext:deno_node/internal/errors.ts:1826:16)
    at ext:deno_node/_fs/_fs_stat.ts:83:97
    at eventLoopTick (ext:core/01_core.js:181:11)

  • I am on Windows
  • Node is v18.16.0
  • Deno is
deno 1.33.2 (release, x86_64-pc-windows-msvc)
v8 11.4.183.1
typescript 5.0.3

Not sure where to start debugging, still a little new to how Deno works.

Let me know if I should put this in a new issue.

@sortofsleepy thanks for the report. Would you mind opening an issue in the Deno repo? This looks like an internal error in Deno that should be fixed there.

bluwy commented

Closing as Deno 1.32.2 is released.