-
Notifications
You must be signed in to change notification settings - Fork 33
Description
When running npx create-actor@latest actor-core-bug
after creating example project with npx create-actor
the studio.rivet.gg opens up but it cannot connect to the server.

Server seems to be running ok:

Background
We had a chat yesterday with @NathanFlurry on X about my issue, so I decided to create this issue so it is easier to communicate here on Github. First of all, here is link to repo https://github.com/valstu/actor-core-bug so you can try it out. I created the repo like this:
- I created a project with command
npx create-actor@latest actor-core-bug
- Selected
Node.js
as platform - Selected
Counter
project as an example project - I ran
npx create-actor@latest actor-core-bug
- Studio opens up but it cannot connect to the server
What I've tested out
When I enabled the inspector on the https://github.com/valstu/actor-core-bug/blob/main/actors/app.ts file like this:
export const app = setup({
actors: { counter },
inspector: {
enabled: true,
}
});
and ran the npx tsx src/index.ts
and then opened up the studio.rivet.gg on the browser it starts to work. Then I'm able to connect to the server.
I also noticed that if I change the app.ts
to following:
export const app = setup({
actors: { counter },
inspector: {
enabled: true,
},
cors: {
origin: (origin) => origin
}
});
As is done on the cli code here https://github.com/rivet-gg/actor-core/blob/a368c8d697f41cdde190ee3400f9d55e1ed79f9a/packages/actor-core-cli/src/server-entry.ts#L9-L11
And run npx tsx src/index.ts
The same problem appears again. And I cannot connect to server anymore.