Eptagone / Vite.AspNetCore

Small library to integrate Vite into ASP.NET projects
MIT License
264 stars 35 forks source link

Examples not running #95

Closed chris-herring closed 9 months ago

chris-herring commented 9 months ago

Describe the bug

Can't get examples or new project to work.

To Reproduce

Downloaded the latest code and have tried the Razor example and the react example under the frameworks folder. Ran npm ic and ran the examples. Neither worked and this error showed in the logs:

Vite.AspNetCore.Services.ViteDevServerStatus: Information: Vite development server started with process ID 91316. PID TT STAT TIME COMMAND 91309 ?? S 0:00.51 /usr/local/bin/dotnet /Users/chris/Development/Test/Vite.AspNetCore-main/examples/basic/frameworks/ViteNET.React/bin/Debug/net8.0/ViteNET.React.dll

vitenet.react@1.0.0 dev /Users/chris/Development/Test/Vite.AspNetCore-main/examples/basic/frameworks/ViteNET.React vite

Also tried the setup steps on the project readme on a "dotnet new webapp" project and it hows this error:

Vite.AspNetCore.Services.ViteDevMiddleware: Warning: Connection refused (localhost:5173). Make sure the Vite development server is running

Device (please complete the following information):

Eptagone commented 9 months ago

Hi. mmm, so the vite dev server is not starting, right? Can you see the vite server running on that port?

chris-herring commented 9 months ago

The dev server should be at https://localhost:5173/@vite/client right? That doesn't load. Dev tools show this:

image
chris-herring commented 9 months ago

Discovered downgrading vite to 4.1.0 works.

Any v5 of vite fails. More info on the error:

info: Vite.AspNetCore.Services.ViteDevServerStatus[0]
      Starting the vite development server...
info: Vite.AspNetCore.Services.ViteDevServerStatus[0]
      Vite development server started with process ID 46589.
Vite.AspNetCore.Services.ViteDevServerStatus: Information: Vite development server started with process ID 46589.
  PID   TT  STAT      TIME COMMAND
46585   ??  S      0:00.56 /usr/local/bin/dotnet /Users/chris/Development/Test/Vite.AspNetCore-main/examples/basic/frameworks/ViteNET.React/bin/Debug/net8.0/ViteNET.React.dll

> react@1.0.0 dev /Users/chris/Development/Test/Vite.AspNetCore-main/examples/basic/frameworks/ViteNET.React
> vite

(node:46593) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '??='
    at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:46593) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:46593) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
info: System.Net.Http.HttpClient.Vite.AspNetCore.DevHttpClient.LogicalHandler[100]
      Start processing HTTP request GET https://localhost:5173/