Giter VIP home page Giter VIP logo

remix-kit's Introduction

RemixKit

Remix development, streamlined with Vite.

An alternative dev server and compiler for the awesome Remix web framework.

Setup

> cd ./your-remix-app
> npx remix-kit@latest install

> npm run vite:dev

Please see the status section and getting started guide for details.

Features

  • Hot Module Replacement (HMR) for instant, precise updates on the browser and server without reloading the page or blowing away application state.
  • Instant development server startup, no pre-bundling required, scales to any project size.
  • Vite for development and build bundling. Includes vite-node for extremely fast targeted server code replacement. No purgeRequireCache needed, keep objects in-memory between requests to match production behavior.
  • Fully configurable & easily extensible
    • An extensible compiler and hooks system gives you complete control.
    • Use hooks from your own plugin modules to extend any part of the build process.
    • Benefit from the large ecosystem of vite plugins.
  • Easy to use CLI remix-kit for development, build, previews and more.
  • Seamless integration of Tailwind CSS with PostCSS. No need for multiple CLIs.
  • View library agnostic, with existing plugin for React.
  • Monorepo support, place your routes in libraries outside the main app to better separate your functionality amongst teams.
  • Integrated dotenv, bundle analysis, hierarchy based remix.config.js, file ignore with .remixignore and much more!

Status

(Alpha) Use to streamline your development but not recommended for production bundling use. Please help test and it can get there though.

Legend: ✅ (Tested),❓ (Untested), ⏳ (Not Supported)

Remix Template Status Install Notes
Remix App Server No changes required after install. Use the default remix-kit preview for the dev:server.
Express Rename the dev:node npm script to dev:server and delete the duplicate dev:server script. Add a require(BUILD_DIR); in the app.listen callback otherwise the first request will fail due to the dev client asynchronously initializing.
Fly
Netlify
Vercel
Deno
Cloudflare Workers
Cloudflare Pages

Packages

Package Changelog
remix-kit Changelog
@remix-kit/kit Changelog
@remix-kit/react Changelog
@remix-kit/schema Changelog
@remix-kit/vite Changelog

Contributing

See CONTRIBUTING.md for information on how to develop RemixKit locally.

Supporting RemixKit

RemixKit is an MIT-licensed open source project with its ongoing development made possible entirely by volunteer time. If you'd like to support this effort, please consider sponsoring.

Credit

This project was bootstrapped using code from Nuxt. Their MIT license can be found here and here. In addition it benefits greatly from a large number of libraries from the UnJS ecosystem. Vite and vite-node provide most of the core functionality and their usage is based on the approach pioneered by @pi0 and described in detail by @antfu at antfu.me.

License

MIT

remix-kit's People

Contributors

aiji42 avatar cliffordfajardo avatar dependabot[bot] avatar jrestall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

remix-kit's Issues

Local Development of `remix-kit` dev

Describe the bug

As a dev wanting to contribute to remix-kit, I would like to run the code in playground/react-app however the dev server is not not working. FYI i'm also new to pnpm based repo's 😅

Reproduction

No response

Steps to reproduce

Following the instructions in CONTRIBUTING.md:

  1. Download a fresh clone of remix-kit (git clone https://github.com/jrestall/remix-kit.git)
  2. cd into remix-kit & run pnpm install at the root of the remix-kit
  3. Run `pnpm build:stub
  4. cd into the playground/react-app folder
  5. Run npx remix-kit dev

After step 5 I get the following error:

ℹ Starting Remix server... node ./build/server.dev.mjs                                                                                                                 04:33:26

node:internal/modules/cjs/loader:998                                                                                                                                   04:33:26
  throw err;
  ^

Error: Cannot find module '/Users/cliffordfajardo/repos/remix-kit/playground/react-app/build/server.dev.mjs'
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.12.0

Video Reproduction

attempting-to-run-react-app.mp4

System Info

System:
    OS: macOS 13.0.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 161.72 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.0 - ~/.volta/tools/image/node/18.12.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 8.19.2 - ~/.volta/tools/image/node/18.12.0/bin/npm
  Browsers:
    Chrome: 108.0.5359.124
    Safari: 16.1
  npmPackages:
    @remix-kit/cli: workspace:* => 0.1.2 
    @remix-kit/feature-blog: workspace: * => 0.1.2 
    @remix-kit/react: workspace:* => 0.1.2 
    @remix-kit/vite: workspace:* => 0.1.2 
    @remix-run/dev: ^1.8.2 => 1.8.2 
    @remix-run/eslint-config: ^1.8.2 => 1.8.2 
    @remix-run/express: ^1.8.2 => 1.8.2 
    @remix-run/node: ^1.8.2 => 1.8.2 
    @remix-run/react: ^1.8.2 => 1.8.2

Used Package Manager

npm

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a RemixKit issue and not a Remix specific issue. For example, if it's a Remix related bug, it should likely be reported to remix instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.

`Error [ERR_REQUIRE_ESM]: require() of ES Module`

Describe the bug

After upgrading from remix-kit 0.1.0 to 0.1.2 in #2 , the next thing I did was run npm run dev
When attempting to setup remix-kit on a new remix express template following the getting started guide, I get the following message when running npm run dev.

RemixKit 0.1.2                                                                03:44:55
Remix 1.9.0                                                                   03:44:55
React 18.2.0                                                                  03:44:55
                                                                              03:44:55
  > Local:    http://localhost:3005/ 
  > Network:  http://192.168.1.65:3005/
  > Network:  http://[2600:1700:7274:8990:1c8c:1998:2c3:deda]:3005/
  > Network:  http://[2600:1700:7274:8990::d]:3005/
  > Network:  http://[2600:1700:7274:8990:c1f5:a550:76ab:5524]:3005/
  > Network:  http://[2600:1700:7274:8990:d9c5:e776:d564:418b]:3005/
  > Network:  http://[2600:1700:7274:8990:ec99:3d87:7099:3b45]:3005/

ℹ Cleaning up generated files and caches...                                   03:44:55
✔ Dev server ready in 767.138ms                                               03:44:55

ℹ Starting Remix server... node ./server.js                                   03:44:55

Express server starting...                                                    03:44:55
Express server listening on port 3000                                         03:44:55
                                                                              03:44:55
ℹ Runner started on http://localhost:3000                                     03:44:55
✔ Remix server ready in 166.13ms                                              03:44:55

ℹ Document request (/)                                                        03:44:57
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/@remix-kit/react/dist/index.mjs not supported.
Instead change the require of /Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/@remix-kit/react/dist/index.mjs to a dynamic import() which is available in all CommonJS modules.
    at /Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:329:121
    at async ViteNodeRunner.interopedImport (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:329:17)
    at async ViteNodeRunner.directRequest (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:237:24)
    at async ViteNodeRunner.cachedRequest (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:173:14)
    at async request (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:199:16)
    at async /Users/cliffordfajardo/repos/remix_kit_repro1/app/root.tsx:5:31
    at async ViteNodeRunner.directRequest (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:312:5)
    at async ViteNodeRunner.cachedRequest (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:173:14)
    at async request (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:199:16)
    at async /Users/cliffordfajardo/repos/remix_kit_repro1/@remix-run/dev/server-build:3:37
    at async ViteNodeRunner.directRequest (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:312:5)
    at async ViteNodeRunner.cachedRequest (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:173:14)
    at async request (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/vite-node/dist/client.cjs:199:16)
    at async RemixKitRunner.executor (/Users/cliffordfajardo/repos/remix_kit_repro1/node_modules/@remix-kit/vite/dist/runtime/dev-entry.mjs:4:13) {
  code: 'ERR_REQUIRE_ESM'
}
ℹ Document request (/favicon.ico)                                             03:44:57

What to Expect as a User

As a user wanting to use remix-kit, I expect few changes to be able to get my existing remix project running
For example, changing scripts in package json and the server.js file (entry point)

Reproduction

https://github.com/cliffordfajardo/remix_kit_repro1

Steps to reproduce

1.Start a new remix express project

$ npx create-remix@latest
? Where would you like to create your app? ./my_remix-kit-example
What type of app do you want to create? (Use arrow keys)
❯ Just the basics
A pre-configured stack ready for production
? Where do you want to deploy? Choose Remix App Server if you're unsure; it's easy to change deployment targets. Express
Server
? TypeScript or JavaScript? TypeScript
? Do you want me to run `npm install`? (Y/n) Y
.
.
.
  1. Install remix kit dependencies per the getting started guided
npm i @remix-kit/vite @remix-kit/react @remix-kit/cli
  1. Start server:
yarn run dev

See my github repo and try to run it, I've upgraded to remix-kit 0.1.2

System Info

System:
    OS: macOS 13.0.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 99.42 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.0 - ~/.volta/tools/image/node/18.12.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 8.19.2 - ~/.volta/tools/image/node/18.12.0/bin/npm
  Browsers:
    Chrome: 108.0.5359.124
    Safari: 16.1
  npmPackages:
    @remix-kit/cli: ^0.1.2 => 0.1.2 
    @remix-kit/react: ^0.1.2 => 0.1.2 
    @remix-kit/vite: ^0.1.2 => 0.1.2 
    @remix-run/dev: ^1.9.0 => 1.9.0 
    @remix-run/eslint-config: ^1.9.0 => 1.9.0 
    @remix-run/express: ^1.9.0 => 1.9.0 
    @remix-run/node: ^1.9.0 => 1.9.0 
    @remix-run/react: ^1.9.0 => 1.9.0

Used Package Manager

npm

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a RemixKit issue and not a Remix specific issue. For example, if it's a Remix related bug, it should likely be reported to remix instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.

Screenshots

CleanShot 2022-12-24 at 03 51 21@2x

CleanShot 2022-12-24 at 03 51 50@2x

DX: Explanations for what each `remix-kit` command do

Description

As user using remix-kit, it would be nice to know what each of the remix-kit commands does

Example Scenario

  1. I create a new remix app (Remix App server)
  2. Setup remix-kit
> cd ./your-remix-app
> npx remix-kit@latest install

> npm run vite:dev
  1. I check the my package.json & see that there are new commands added to my scripts section:
    CleanShot 2022-12-30 at 10 11 57@2x

when should I use some of the commands over the other?

  • "vite:preview": "remix-kit preview", is straight forward IMO

but these other 3 are less straight forward:

  • "vite:dev": "remix-kit dev --origin http://localhost:3000",
  • "vite:preview": "remix-kit preview",
  • "dev:server": "remix-kit preview"

Questions

  1. Are "vite:preview" and ``"dev:server"` use the same shell command, is this intentional? I found it confusing seeing 2 different script commands that each call the same thing
  2. When would i use npm run vite:dev over npm run dev:server?

Suggested solution

Perhaps Adding documentation on each of the remix-kit commands, perhaps a table of when to use them
or
a new Remix CLI command that outputs what all the commands do in one STDOUT output

# we could link this in the README too
`npx remix-kit --help`

I think this is still useful:

npx remix [command] --help

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Remix App Server Template: `Error: couldn't find exported server build` & `WebSocket server error: Port is already in use`

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:

npx remix-kit@latest install

I get the following error:

Error: couldn't find exported server build from ../my-remix-app/build/index.js

CleanShot 2022-12-30 at 09 11 57@2x

Then after quitting the process and trying to restart I get this web socket error message:

ERROR  WebSocket server error: Port is already in use

Video Reproduction

  1. Installed fresh remix app server template, ran npx remix-kit@latest install then remix-kit preview per the Status section on the readme which talkes about using remix-kit preview for remix apps that are using the Remix App Server
01-remix-app-server---premix-kit-preview.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)
  1. Following the first instructions at the top of the README
> cd ./your-remix-app
> npx remix-kit@latest install
> npm run vite:dev
02-remix-app-server---vite-dev.mp4

Steps to reproduce

1.Install a fresh remix app & choose Remix App Server

$ npx create-remix@latest
? Where would you like to create your app? ./my-remix-app
? What type of app do you want to create? Just the basics
? Where do you want to deploy? Choose Remix App Server if you're unsure; it's
easy to change deployment targets. Remix App Server
  1. cd into the newly created remix app & setup and run remix-kit using the following commands
$ cd my-remix-app
$ npx remix-kit@latest install
$ npm run vite:dev
Remix 1.9.0                                     
React 18.2.0
> Local:       http://localhost:3005/ 
> Network:  http://192.168.1.65:3005/

# ----------- visit the URL http://localhost:3005/ 
Error: couldn't find exported server build from ../my-remix-app/build/index.js
  1. Kill the process (ctrl + c), run npm run build
  2. Attempt to restart server npm run vite:dev and you get the following error:
WebSocket server error: Port is already in use

Recommendations

  1. 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 server

  2. If 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 well

  3. In 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)

CleanShot 2022-12-30 at 09 48 17@2x

To avoid confusion, we could simply link to this below the Setup section:

CleanShot 2022-12-30 at 09 56 17@2x

System Info

System:
    OS: macOS 13.0.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 194.47 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.0 - ~/.volta/tools/image/node/18.12.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 8.19.2 - ~/.volta/tools/image/node/18.12.0/bin/npm
  Browsers:
    Chrome: 108.0.5359.124
    Safari: 16.1
  npmPackages:
    @remix-kit/react: ^0.2.1 => 0.2.1 
    @remix-kit/vite: ^0.2.1 => 0.2.1 
    @remix-run/dev: ^1.9.0 => 1.9.0 
    @remix-run/eslint-config: ^1.9.0 => 1.9.0 
    @remix-run/node: ^1.9.0 => 1.9.0 
    @remix-run/react: ^1.9.0 => 1.9.0 
    @remix-run/serve: ^1.9.0 => 1.9.0

Used Package Manager

npm

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a RemixKit issue and not a Remix specific issue. For example, if it's a Remix related bug, it should likely be reported to remix instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.

enhancement: Possibility to use SolidJS?

Description

Just found about this solution and first of all, Thank you for doing it. Projects like this matter.

I was wondering if we could use SolidJS as the view library since u mentioned agnostic, I don't know if it's doable with Remix internals but SolidJS in Remix would be the cherry on top of the cake, at least until Solid Start reaches stable and gets mature.

Thank you everyone involved in this project and Happy Holidays🎅

Suggested solution

Provide a @remix-kit/solidjs package

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

vite plugin for Static Site Generation (SSG)

Description

As a developer moving from Nextjs that is used to static site generation, it would be nice to be able to use SSG in my remix app

Suggested solution

Create a vite plugin that can do SSG for you when you run npm run build

Background context
One of the questions i hear alot about remix is that if can do static site generation.
For folks wanting to use remix to build marketing sites, homepage's or even blog's, this could be a useful.
Useful for environments that where you can't or are not allowed to easily provision your own server and only have access to pushing static files to server/CDN

Alternative

Manual Approach

The alternative is setting this up manually by writing your own script
For example. create script that will:

  • start your remix app
  • then have your crawler in your script, visit a list of urls in your app (AKA your static pages) get the HTML output
    • save the HTML output from visiting the page to a public or static directory
  • ...

More details on a basic implementation for conceptual purposes

Vite plugin approach

  • users wouldn't need to write a manual script
  • plugin can tap into vite SSR apis and build lifecycle
  • user's can pass options object to vite plugin

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

DX: Improving experience for remix apps created with the default Remix App Server template

Description

As a remix user who would like to use remix-kit, I'd like the onboarding experience for using remix-kit with a Remix App Server template to be easier. This would help drive adoption of remix-kit and push the Remix community forward 💿 ⚛️

Suggested solution

Documentation for how to use remix-kit with the Remix App Server template.
I recently tried remix-vite and found the getting started experience very friendly.

All I had to do was this:

$ npx create-remix@latest

$ cd new_remix_app
$ npx remix-vite


remix-vite started at http://localhost:3000

// visit page in browser
[vite] hmr update /app/routes/index.tsx

After npx remix-vite command the remix app starts up and HMR support works

Is this sometimes that might be possible with remix-vite?
I understand remix-kit does a lot more that remix-vite so its not an apple to apple comparison. I think its an aspirational level of DX to strive for though

Alternative

Maybe we can grab inspiration from remix-vite experience for Remix App Server (RAS) template.
The alternative is to direct users to only use the express template from Remix; I think making RAS work more seemlessly would be good though
Remix App Server is also a common template lots of people use to hack and prototype on projects and then publish to Vercel so supporting Remix App Server could be impactful

If remix-kit is able to support the standard Remix App Server template and the express template (which it does already) I think it could inspire the core Remix team & community:

Imagined scenario lol 😄 :

Remix Team Core Member: 
Hey team, have you seen. remix-kit? It has great DX for Remix App Server and Express template out of the box.
This covers the majority of use cases people have. 
We should talk with them or grab inspiration from them to improve the DX in remix core

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

No HMR / 404 on client requests

Describe the bug

hey, I followed the instructions in https://github.com/jrestall/remix-kit/blob/main/CONTRIBUTING.md and this happens when visiting localhost:3000

at first I tried just cloning the playground/react-app folder and removing workspace/project references + using packages from npm but I had this issue so I thought of trying in the remix-kit repo directly

have I missed something ?
pnpm i / pnpm build:stub / cd playground/react-app / pnpm dev

in the console it looks like

Screenshot 2022-12-28 at 11 54 43

and in the network tab

Screenshot 2022-12-28 at 11 54 33
ex: the first error is on the url
http://localhost:3000/Users/astahmer/dev/open-source/remix-kit/playground/react-app/app/entry.client.tsx

Reproduction

No response

Steps to reproduce

No response

System Info

No response

Used Package Manager

pnpm

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a RemixKit issue and not a Remix specific issue. For example, if it's a Remix related bug, it should likely be reported to remix instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.

Failed to import iconoir-react in production mode

Describe the bug

When I build an application which uses iconoir-react package for production and try to run remix-kit preview, I get this error:

Screenshot 2022-12-25 at 15 05 26

What I tried:

  1. Added 'type': 'module' in package.json
  2. Added 'iconoir-react': 'iconoir-react/dist/esm' in resolve.alias
  3. Changed from server.production.js to server.production.mjs
  4. Added serverDependenciesToBundle: ['iconoir-react'] in remix.config.js

The development server works like a charm, but production preview throws. Also the same remix project using the default build system works too.

Reproduction

No response

Steps to reproduce

  1. Create a remix-kit project
  2. Add iconoir-react
  3. Build for production
  4. Try to run remix-kit preview

System Info

System:
    OS: macOS 13.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 108.45 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.asdf/installs/nodejs/lts-hydrogen/bin/node
    Yarn: 1.22.19 - ~/.asdf/shims/yarn
    npm: 8.19.2 - ~/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Firefox: 107.0.1
    Safari: 16.2
  npmPackages:
    @remix-kit/cli: ^0.1.2 => 0.1.2 
    @remix-kit/react: ^0.1.2 => 0.1.2 
    @remix-kit/vite: ^0.1.2 => 0.1.2 
    @remix-run/dev: ^1.9.0 => 1.9.0 
    @remix-run/express: ^1.9.0 => 1.9.0 
    @remix-run/node: ^1.9.0 => 1.9.0 
    @remix-run/react: ^1.9.0 => 1.9.0 
    @remix-run/serve: ^1.9.0 => 1.9.0 
    @remix-run/server-runtime: ^1.9.0 => 1.9.0

Used Package Manager

pnpm

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a RemixKit issue and not a Remix specific issue. For example, if it's a Remix related bug, it should likely be reported to remix instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.

`Error: listen EADDRINUSE: address already in use :::3000`

Describe the bug

When attempting to setup remix-kit on a remix express template following the getting started guide, I get the following message when running npm run dev

RemixKit 0.1.0                                                                         22:12:00
Remix 1.9.0                                                                            22:12:00
React 18.2.0                                                                           22:12:00
                                                                                       22:12:00
  > Local:    http://localhost:3000/                                                   22:12:00
  > Network:  http://192.168.1.65:3000/
  > Network:  http://[2600:1700:7274:8990:1c8c:1998:2c3:deda]:3000/
  > Network:  http://[2600:1700:7274:8990::16]:3000/
  > Network:  http://[2600:1700:7274:8990:c1f5:a550:76ab:5524]:3000/
  > Network:  http://[2600:1700:7274:8990:d9c5:e776:d564:418b]:3000/
  > Network:  http://[2600:1700:7274:8990:ec99:3d87:7099:3b45]:3000/

ℹ Cleaning up generated files and caches...                                            22:12:00
✔ Dev server ready in 640.887ms                                                        22:12:01

ℹ Starting Remix server... node ./server.js                                            22:12:01

Express server starting...                                                             22:12:01
Error: listen EADDRINUSE: address already in use :::3000                               22:12:01
    at Server.setupListenHandle [as _listen2] (node:net:1485:16)
    at listenInCluster (node:net:1533:12)
    at Server.listen (node:net:1621:7)
    at Function.listen (/Users/cliffordfajardo/repos/remix-kit-example-app/node_modules/express/lib/application.js:635:24)
    at Object.<anonymous> (/Users/cliffordfajardo/repos/remix-kit-example-app/server.js:40:5)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

Reproduction

https://github.com/cliffordfajardo/remix_kit_repro1

Steps to reproduce

1.Start a new remix express project

$ npx create-remix@latest
? Where would you like to create your app? ./my_remix-kit-example
What type of app do you want to create? (Use arrow keys)
❯ Just the basics
A pre-configured stack ready for production
? Where do you want to deploy? Choose Remix App Server if you're unsure; it's easy to change deployment targets. Express
Server
? TypeScript or JavaScript? TypeScript
? Do you want me to run `npm install`? (Y/n) Y
.
.
.
  1. Install remix kit dependencies:
npm i @remix-kit/vite @remix-kit/react @remix-kit/cli
  1. Start server:
yarn run dev

System Info

System:
    OS: macOS 13.0.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 106.28 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.0 - ~/.volta/tools/image/node/18.12.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 8.19.2 - ~/.volta/tools/image/node/18.12.0/bin/npm
  Browsers:
    Chrome: 108.0.5359.124
    Safari: 16.1
  npmPackages:
    @remix-kit/cli: ^0.1.0 => 0.1.0 
    @remix-kit/react: ^0.1.0 => 0.1.0 
    @remix-kit/vite: ^0.1.0 => 0.1.0 
    @remix-run/dev: ^1.9.0 => 1.9.0 
    @remix-run/eslint-config: ^1.9.0 => 1.9.0 
    @remix-run/express: ^1.9.0 => 1.9.0 
    @remix-run/node: ^1.9.0 => 1.9.0 
    @remix-run/react: ^1.9.0 => 1.9.0 


### Used Package Manager

npm

### Validations

- [X] Read the [Contributing Guidelines](https://github.com/jrestall/remix-kit/blob/main/CONTRIBUTING.md).
- [X] Check that there isn't [already an issue](https://github.com/jrestall/remix-kit/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a RemixKit issue and not a Remix specific issue. For example, if it's a Remix related bug, it should likely be reported to [remix](https://github.com/remix-run/remix) instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/jrestall/remix-kit/discussions).

Updating loader code and refreshing the page does not reflect new changes

Describe the bug

If you spin up the remix app (Remix App Server template) using npm run vite:dev and make changes to your loader and refresh the page, the new data from the loader is not reflected

Steps to reproduce

  1. Create a new Remix app npx remix-kit@latest install and choose the Remix App Server template
  2. cd my-remix-app
  3. Install remix kit npx remix-kit@latest install
  4. Start remix app using vite npm run vite:dev
  5. Add a loader to routes/index.tsx and return a value
  6. Load the page
  7. Add a new value like 4 to the array and refresh the page, & youll see the server changes are not being reflected

If you use npm run dev (no vite) things work as expected after page reload, so it looks like its the vite dev server

Reproduction

001-vite-server-not-working.mp4

Example Code for routes/index.tsx

routes/index.tsx

import { type LoaderArgs, json } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";

export async function loader({ request }:LoaderArgs) {
  return json([ 1,2,3, ]) // ❌ after the initial page load, add a 4 inside the array and refresh the page
}

export default function Index() {
  const data = useLoaderData();
  return (
    <div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4", }}>
      <h1>Welcome to Remix</h1>
      <ul>
        {data.map((item:any) => (
          <li style={{color: 'pink'}}>{item}</li>
        ))}
      </ul>
    </div>
  );
}

System Info

System:
    OS: macOS 13.0.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 189.13 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.0 - ~/.volta/tools/image/node/18.12.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 8.19.2 - ~/.volta/tools/image/node/18.12.0/bin/npm
  Browsers:
    Chrome: 108.0.5359.124
    Safari: 16.1
  npmPackages:
    @remix-kit/react: ^0.2.2 => 0.2.2 
    @remix-kit/vite: ^0.2.2 => 0.2.2 
    @remix-run/dev: ^1.9.0 => 1.9.0 
    @remix-run/eslint-config: ^1.9.0 => 1.9.0 
    @remix-run/node: ^1.9.0 => 1.9.0 
    @remix-run/react: ^1.9.0 => 1.9.0 
    @remix-run/serve: ^1.9.0 => 1.9.0

Used Package Manager

npm

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a RemixKit issue and not a Remix specific issue. For example, if it's a Remix related bug, it should likely be reported to remix instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.