react-chess / chessground

Chessground React Wrapper
https://www.npmjs.com/package/@react-chess/chessground
GNU General Public License v3.0
29 stars 5 forks source link

Chessboard is not rendering since 1.2.4 release #10

Closed geektechniquestudios closed 2 years ago

geektechniquestudios commented 2 years ago

I upgraded my dependencies earlier and now the chessground chessboard doesn't render. If I touch the chessground dependency, the yarn.lock file updates to have this entry

"@react-chess/chessground@npm:^1.2.4":
  version: 1.2.4
  resolution: "@react-chess/chessground@npm:1.2.4"
  dependencies:
    chessground: 7.12.0
  peerDependencies:
    react: ^16.8.0 || ^17.0.0
    react-dom: ^16.8.0 || ^17.0.0
  checksum: 36fd347205a3dab631fc0910cdf6453fd1c33a3f1135e87f00906eac5044543b46c379730ad604228aa950d1fad67030748f023d0b9b6136193f9da79528cd84
  languageName: node
  linkType: hard

Even if I try to use an earlier version, like 1.2.3 or 1.2.2, it just bugs on me and doesn't work. So my temporary workaround is to manually edit my lockfile with this

"@react-chess/chessground@npm:^1.2.2":
  version: 1.2.3
  resolution: "@react-chess/chessground@npm:1.2.3"
  dependencies:
    chessground: 7.12.0
  peerDependencies:
    react: ^16.8.0 || ^17.0.0
    react-dom: ^16.8.0 || ^17.0.0
  checksum: 195d5d79625518a75b49e6584b4538bf7ba8e2884c4c042a04dc7d4970ea127460d8a875c6bd5b1e644562f6e299431e5eb186bbfc93943f1bfaa4194781eec4
  languageName: node
  linkType: hard

I believe the commit where you remove global CSS or remove "type": module from the package json is the problem 887c7b42fcdb9d9409d97a7653c61ef99d1d918b.

I'm using yarn 3.2.0 as my package manager.

Thank you for maintaining this repo. I really appreciate your hard work.

H-Richard commented 2 years ago

should be fixed now!

geektechniquestudios commented 2 years ago

Unfortunately, I just tried upgrading, and the chess board still isn't rendering for me on the latest version, 1.3.2.

H-Richard commented 2 years ago

Unfortunately, I just tried upgrading, and the chess board still isn't rendering for me on the latest version, 1.3.2.

Did you import the css files?

H-Richard commented 2 years ago

Check out this CodeSandbox example (its in JS unfortunately), can you tell me what stack you're using? https://codesandbox.io/s/gifted-borg-lgp1po?file=/src/App.js

geektechniquestudios commented 2 years ago

I wasn't including the css imports by accident. It was working without them in the old release though. Thanks so much for helping me figure that out. It works for me now.

On another note, It seems the color of the squares changed. It's not the same color as lichess chessboards anymore. I don't see a way to control the theme in the config. Sorry if I'm missing something. Is there a way to control the color through React props or any other way?

Thanks for all your help.

H-Richard commented 2 years ago

honestly no idea lol, it looks like the default styles changed https://github.com/lichess-org/chessground/commits/master/assets/chessground.brown.css here a while ago, I'm investigating too, I'll let you know if I find out,