Open cliffordfajardo opened 1 year ago
Thanks for the report Clifford! I can reproduce and will fix as a priority. That'll teach me for testing using jiti stubs.
v0.2.2 released with a fix for the urgent "Error: couldn't find exported server build from ../my-remix-app/build/index.js".
The websocket error is a little trickier as it's caused by the dev server restarting due to the cleanup of /public/build folder. That should only happen once if previously used the remix build/dev command, so I'll fix it but will drop the bug severity.
Describe the bug
After creating a fresh app using the
Remix App Server
template and running the following command inside the roof of my newly created remix app:I get the following error:
Then after quitting the process and trying to restart I get this web socket error message:
Video Reproduction
npx remix-kit@latest install
thenremix-kit preview
per the Status section on the readme which talkes about usingremix-kit preview
for remix apps that are using the Remix App Serverhttps://user-images.githubusercontent.com/6743796/210098110-8213f2a8-50aa-4add-b46a-6938a908d9e1.mp4
Console output w/errors
``` ERROR Cannot find module '/Users/cliffordfajardo/repos/remix_kit_repro1/remix-kit-playgrounds/my-remix-app/build/index.js' imported from /Users/cliffordfajardo/repos/remix_kit_repro1/remix-kit-playgrounds/my-remix-app/node_modules/@remix-kit/vite/dist/vite.cjs at new NodeError (node:internal/errors:393:5) at finalizeResolution (node:internal/modules/esm/resolve:323:11) at moduleResolve (node:internal/modules/esm/resolve:916:10) at defaultResolve (node:internal/modules/esm/resolve:1124:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:841:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ESMLoader.import (node:internal/modules/esm/loader:525:22) at importModuleDynamically (node:internal/modules/cjs/loader:1098:29) at importModuleDynamicallyWrapper (node:internal/vm/module:438:21) ```https://user-images.githubusercontent.com/6743796/210098562-733f649e-9686-45e0-8fad-6fffa12591f4.mp4
Steps to reproduce
1.Install a fresh remix app & choose
Remix App Server
cd
into the newly created remix app & setup and run remix-kit using the following commandsctrl + c
), runnpm run build
npm run vite:dev
and you get the following error:Recommendations
Ideally, when you kill the process that starts from
npm run vite:dev
, the websocket server should be terminated to avoid hitting this web socket error on subsequent attempts to restart the serverIf we do encounter the
WebSocket server error: Port is already in use
it would be nice to get printed in the console the port that this web socket server is running on so we could kill it as wellIn the readme, when looking at these instructions, there is no way to tell if this command is for apps using
Remix App Template
or apps that have their own `server.{js,mjs} files (express template)To avoid confusion, we could simply link to this below the Setup section:
System Info
Used Package Manager
npm
Validations