You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first part which has you run these commands works fine:
npx create-react-app bgio-tutorial
cd bgio-tutorial
npm install boardgame.io
touch src/Game.js
If at this point you do an "npm start" you get a normal React app placeholder launched in the browser and everything seems okay.
However, the next step in the tutorial replaces src/App.js . After doing this and running "npm start", I get this error:
Error in ./~/boardgame.io/dist/cjs/react.js
Module parse failed: /home/wjl/work/boardgame.io-tutorial/bgio-tutorial/node_modules/boardgame.io/dist/cjs/react.js Unexpected token (118:24)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (118:24)
@ ./src/App.js 7:13-42
I've used both Nodejs and React for a few small projects, but I'm by no means fluent with them. But the "cjs" caught my eye and after some searching on the web I played around with some advice there, installed the esm module, changed index.js to force esm use, and eventually kind of got it to launch, but at that point it had other problems (the boardgame.io debug interface ran but wouldn't update game state) and still couldn't finish the tutorial.
For background this was done on an Ubuntu 22.04.01 LTS system using the nodejs snap. (The nodejs deb package is too old to work with React.) Node version is:
node --version
v18.13.0
Anyway, I'm going to try the tutorial again without React, but I wanted to let you know that the tutorial, at least for me, appears to be broken. My best guess is that something changed with React or with some other dependency, and it's probably an easy fix for someone who knows what they are doing. =)
The text was updated successfully, but these errors were encountered:
If it helps, here are the package.json and package-lock.json generated by running the tutorial commands (the only difference in this case was I used a different folder name, "tictactoe-react" so I didn't clobber the plainjs version I just tried). I didn't manually edit these files at all.
I tried following the tutorial here, using the React version: https://boardgame.io/documentation/#/tutorial
The first part which has you run these commands works fine:
If at this point you do an "npm start" you get a normal React app placeholder launched in the browser and everything seems okay.
However, the next step in the tutorial replaces src/App.js . After doing this and running "npm start", I get this error:
I've used both Nodejs and React for a few small projects, but I'm by no means fluent with them. But the "cjs" caught my eye and after some searching on the web I played around with some advice there, installed the esm module, changed index.js to force esm use, and eventually kind of got it to launch, but at that point it had other problems (the boardgame.io debug interface ran but wouldn't update game state) and still couldn't finish the tutorial.
For background this was done on an Ubuntu 22.04.01 LTS system using the nodejs snap. (The nodejs deb package is too old to work with React.) Node version is:
Anyway, I'm going to try the tutorial again without React, but I wanted to let you know that the tutorial, at least for me, appears to be broken. My best guess is that something changed with React or with some other dependency, and it's probably an easy fix for someone who knows what they are doing. =)
The text was updated successfully, but these errors were encountered: