Navigation

  • Recent
  • Tags
  • Users
  • Search
  • Login
Colyseus
  • Login
  • Search
  • Recent
  • Tags
  • Users

Documentation GitHub

We're migrating to GitHub Discussions. This forum does not accept new registrations since April 6, 2023.
  1. Home
  2. Radishoux
Radishoux

Radishoux

@Radishoux

Chat Follow Unfollow
0
Reputation
1
Posts
651
Profile views
0
Followers
0
Following
Joined 3 May 2020, 02:49 Last Online 4 May 2020, 14:58

  • Profile
  • More
    • Continue chat with Radishoux
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups
Radishoux Follow

Posts made by Radishoux

Cannot find module './rooms/room2

Hi, i'm trying to build a project with multiple chat-rooms on it, each room has a different front web on it
so i pulled the colyseus/colyseus-examples from GH to try and managed to open the example rooms and modify their fronts. (love your work btw)
but now i want to have 01-chat-room multiple times, like 02-chat-room, 03 and so on...
so i copy pasted my rooms/01-chat-room.ts into rooms/02-chat-room.ts, as well as the static/01-chat-room.html in a static/02-chat-room.html
in the index.ts i also copyed the snippets involving ChatRoom, which is imported from ./rooms/01... as
export class ChatRoom extends Room {
and pasted as involving ChatRoom2, which is the class imported from ./rooms/02... as
export class ChatRoom2 extends Room {

`

import { ChatRoom } from "./rooms/01-chat-room";
import { ChatRoom2 } from "./rooms/02-chat-room";

gameServer.define("chat", ChatRoom)
.enableRealtimeListing();

gameServer.define("chat_with_options", ChatRoom, {
custom_options: "you can use me on Room#onCreate"
});

gameServer.define("chat", ChatRoom2)
.enableRealtimeListing();

gameServer.define("chat_with_options", ChatRoom2, {
custom_options: "you can use me on Room#onCreate"
});

`

i thought it would be that easy but it's not, i must have forgot a step
please tell me which one

now when i npm start, the server says :

TSError: ⨯ Unable to compile TypeScript:
index.ts:12:27 - error TS2307: Cannot find module './rooms/02-chat-room'.

12 import { ChatRoom2 } from "./rooms/02-chat-room";

//

thanks for help
luv from france

posted in Questions & Help • 3 May 2020, 03:15

© 2023 Endel Dreyer