<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Cannot find module &#x27;.&#x2F;rooms&#x2F;room2]]></title><description><![CDATA[<p>Hi, i'm trying to build a project with multiple chat-rooms on it, each room has a different front web on it<br />
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)<br />
but now i want to have 01-chat-room multiple times, like 02-chat-room, 03 and so on...<br />
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<br />
in the index.ts i also copyed the snippets involving ChatRoom, which is imported from ./rooms/01... as<br />
<code>export class ChatRoom extends Room {</code><br />
and pasted as involving ChatRoom2, which is the class imported from ./rooms/02... as<br />
<code>export class ChatRoom2 extends Room {</code></p>
<p>`</p>
<p>import { ChatRoom } from &quot;./rooms/01-chat-room&quot;;<br />
import { ChatRoom2 } from &quot;./rooms/02-chat-room&quot;;</p>
<p>gameServer.define(&quot;chat&quot;, ChatRoom)<br />
.enableRealtimeListing();</p>
<p>gameServer.define(&quot;chat_with_options&quot;, ChatRoom, {<br />
custom_options: &quot;you can use me on Room#onCreate&quot;<br />
});</p>
<p>gameServer.define(&quot;chat&quot;, ChatRoom2)<br />
.enableRealtimeListing();</p>
<p>gameServer.define(&quot;chat_with_options&quot;, ChatRoom2, {<br />
custom_options: &quot;you can use me on Room#onCreate&quot;<br />
});</p>
<p>`</p>
<p>i thought it would be that easy but it's not, i must have forgot a step<br />
please tell me which one</p>
<p>now when i npm start, the server says :</p>
<p>TSError: ⨯ Unable to compile TypeScript:<br />
index.ts:12:27 - error TS2307: Cannot find module './rooms/02-chat-room'.</p>
<p>12 import { ChatRoom2 } from &quot;./rooms/02-chat-room&quot;;</p>
<p>//</p>
<p>thanks for help<br />
luv from france</p>
]]></description><link>http://discuss.colyseus.io/topic/358/cannot-find-module-rooms-room2</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Mar 2026 20:38:13 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/358.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 03 May 2020 03:15:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Cannot find module &#x27;.&#x2F;rooms&#x2F;room2 on Invalid Date]]></title><description><![CDATA[<p>Hi, i'm trying to build a project with multiple chat-rooms on it, each room has a different front web on it<br />
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)<br />
but now i want to have 01-chat-room multiple times, like 02-chat-room, 03 and so on...<br />
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<br />
in the index.ts i also copyed the snippets involving ChatRoom, which is imported from ./rooms/01... as<br />
<code>export class ChatRoom extends Room {</code><br />
and pasted as involving ChatRoom2, which is the class imported from ./rooms/02... as<br />
<code>export class ChatRoom2 extends Room {</code></p>
<p>`</p>
<p>import { ChatRoom } from &quot;./rooms/01-chat-room&quot;;<br />
import { ChatRoom2 } from &quot;./rooms/02-chat-room&quot;;</p>
<p>gameServer.define(&quot;chat&quot;, ChatRoom)<br />
.enableRealtimeListing();</p>
<p>gameServer.define(&quot;chat_with_options&quot;, ChatRoom, {<br />
custom_options: &quot;you can use me on Room#onCreate&quot;<br />
});</p>
<p>gameServer.define(&quot;chat&quot;, ChatRoom2)<br />
.enableRealtimeListing();</p>
<p>gameServer.define(&quot;chat_with_options&quot;, ChatRoom2, {<br />
custom_options: &quot;you can use me on Room#onCreate&quot;<br />
});</p>
<p>`</p>
<p>i thought it would be that easy but it's not, i must have forgot a step<br />
please tell me which one</p>
<p>now when i npm start, the server says :</p>
<p>TSError: ⨯ Unable to compile TypeScript:<br />
index.ts:12:27 - error TS2307: Cannot find module './rooms/02-chat-room'.</p>
<p>12 import { ChatRoom2 } from &quot;./rooms/02-chat-room&quot;;</p>
<p>//</p>
<p>thanks for help<br />
luv from france</p>
]]></description><link>http://discuss.colyseus.io/post/1191</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1191</guid><dc:creator><![CDATA[Radishoux]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>