Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using without react ? #1165

Open
LelouBil opened this issue Sep 17, 2023 · 2 comments
Open

Using without react ? #1165

LelouBil opened this issue Sep 17, 2023 · 2 comments

Comments

@LelouBil
Copy link

LelouBil commented Sep 17, 2023

I just started a new project with only boardgame.io using bun and upon running this simple file :

import {Server} from "boardgame.io/server";
import {Origins} from "boardgame.io/server";


const server = Server({
    // Provide the definitions for your game(s).
    games: [],

    // Provide the database storage class to use.
    db: new DbConnector(),

    origins: [Origins.LOCALHOST_IN_DEVELOPMENT],
});

server.run(8000);

I get this error
error: Cannot find package "react" from "/<project-folder>/node_modules/boardgame.io/dist/boardgameio.js"

@psalaets
Copy link

I'm not completely sure why or if this matters, but this is the import statement I use

import { Origins, Server } from 'boardgame.io/server';

Quickly scanning through my codebase, I've noticed that the only imports from boardgame.io are type imports. Everything else is imported using boardgame.io/<something>.

@LelouBil
Copy link
Author

Yes, my bad. I uploaded the wrong version. I'll fix the issue.

And I also want to mention that I switch to just using node, and I'm facing the same issue, that boardgame.io can't be used without react installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants