GithubHelp home page GithubHelp logo

partykit / remix-starter Goto Github PK

View Code? Open in Web Editor NEW
64.0 3.0 2.0 192 KB

๐ŸŽˆ PartyKit โคซ Remix ๐Ÿ’ฟ

License: MIT License

JavaScript 4.52% TypeScript 95.48%
collaborative multiplayer partykit react real-time remix-stack serverless websockets yjs

remix-starter's Introduction

Welcome to ๐ŸŽˆ PartyKit โคซ Remix ๐Ÿ’ฟ!

This is a starter template for Remix and PartyKit. You can create a new project based on this template with the Remix CLI:

npx create-remix@latest --template partykit/remix-starter

NB: This is a beta release, so expect some rough edges. Please file issues or feedback at https://github.com/partykit/remix-starter!

Development

You will be running two processes during development:

  • The Remix development server
  • The PartyKit server

Both are started with one command:

npm run dev

Open up http://127.0.0.1:1999 and you should be ready to go!

If you want to check the production build, you can stop the dev server and run following commands:

npm run build
npm start

Then refresh the same URL in your browser (no live reload for production builds).

Deployment

npm run deploy

If you don't already have a PartyKit account, you'll be prompted to create one during the deploy process.

Thanks

(This starter based on the original template for Cloudflare Workers)

remix-starter's People

Contributors

erikras avatar threepointone 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

Watchers

 avatar  avatar  avatar

Forkers

purebase erikras

remix-starter's Issues

"No matching version found for partykit@^1.19.3" on fresh install

Trying to run the sample command, get this error after being asked whether i want to run npm install

npm ERR! code ETARGET
npm ERR! notarget No matching version found for partykit@^1.19.3.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in: /Users/esra/.npm/_logs/2023-08-30T03_36_08_994Z-debug-0.log
Command failed: npm install

I'll figure it out, but thought you'd want to know :)

HTTP status 522 when fetching a room from the server

Description:
Fetching a room from the server (loader or action) via HTTP request works fine locally, but fails consistently with a 522 HTTP status when deployed. I am not sure if this is a Remix-specific issue, but since I've only tried with this starter, and it's seemingly easy to reproduce I'll put it here, lmk if I should move it elsewhere.

Steps to reproduce:

  1. Create a new Partykit app: npx create-remix@latest ./my-partymix-app --template partykit/remix-starter
  2. Replace the loader in routes/_index.tsx with the following code:
export async function loader() {
  const room = await PartySocket.fetch({
    host: PARTYKIT_HOST,
    room: "123",
  });

  if (!room.ok) {
    throw json({
      error: await room.text(),
    }, { 
      status: room.status
    });
  }

  return json({ partykitHost: PARTYKIT_HOST, room: await room.json() });
}
  1. Add the following handler to party/main.ts:
onRequest() {
  return Response.json({ hello: "world" });
}
  1. Deploy the app, and watch it throw an error with the 522 HTTP status when you visit it. It works fine locally. I have deployed the exact code above here: https://522-demo.haakonmt.partykit.dev/

EDIT: It might be of importance that I'm located in Oslo, Norway, which CloudFlare currently lists as being re-routed, I'm not really sure what that implies:
Skjermbilde 2023-12-30 kl  18 50 13

Error: Can't establish a connection to the server

Steps to Reproduce

  1. npx create-remix@latest --template partykit/remix-starter
  2. npm run dev
  3. Open browser console

Description

The browser console displays web socket errors when initiating a newly created app. Upon the first opening, the app seems to connect, but sometimes when a second tab is opened to simulate a new user, the connection hangs and fails to update the user count. Subsequently, refreshing the page also results in a failed connection. No errors are shown in the terminal, only in the browser console. I am using Firefox (version below) but the errors are still present on Chrome as well.

Error Message

partykit-remix-error
partykit-remix-error2

Environment

  • Operating System: Windows 10
  • Browser: Firefox Developer Edition 123.0b2

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.