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

I have to modify code in Goban so that it can be built using preact-cli #13

Closed
golf-x opened this issue May 18, 2019 · 11 comments
Closed
Labels
question Further information is requested

Comments

@golf-x
Copy link

golf-x commented May 18, 2019

image

I have to modify code in Goban right this so it can be built in preact-cli without any problems, am i missing something here ?

@yishn
Copy link
Member

yishn commented May 19, 2019

You’re probably using an old version of preact. Use a version that supports getDerivedStateFromProps, such as 8.4.2.

@yishn yishn added the question Further information is requested label May 19, 2019
@yishn yishn closed this as completed May 19, 2019
@golf-x
Copy link
Author

golf-x commented May 19, 2019

image
Upgraded to preact 8.4.2 but still does not work

@yishn
Copy link
Member

yishn commented May 19, 2019

Can you build and run the demo?

@golf-x
Copy link
Author

golf-x commented May 20, 2019

Can you build and run the demo?

Yes, I can.

@golf-x
Copy link
Author

golf-x commented May 21, 2019

I create a new preact project using create-preact-app with material template here and use Goban in shudan. it does not work.

Here is the git repository.
https://github.com/restingisimportant/preact-cli-shudan

Also i don't know why the stone does not appeared now, i must be missing something

@yishn
Copy link
Member

yishn commented May 21, 2019

In the git repository, you’re using an old version of preact. Are you sure you tried updating preact to 8.4.2?

@golf-x
Copy link
Author

golf-x commented May 21, 2019

In the git repository, you’re using an old version of preact. Are you sure you tried updating preact to 8.4.2?

Hi, Sorry i forgot to update it for this one, now i updated it already. but problems still persist.

image

Also, the board does not show up completely

@yishn
Copy link
Member

yishn commented May 21, 2019

I suspect it's a transpilation issue of [...Array(n)]. I've changed it to Array(n).fill(0) to circumvent it. Can you try updating Shudan to v1.3.12 and see if it's working for you?

@yishn yishn reopened this May 21, 2019
@golf-x
Copy link
Author

golf-x commented May 21, 2019

image
Board does show correctly now.

image
However, build command still not success.

You can test by this repository
https://github.com/restingisimportant/preact-cli-shudan

@yishn
Copy link
Member

yishn commented May 24, 2019

It seems like preact-cli doesn't support getDerivedStateFromProps during prerender yet. Either don't use prerender (by running preact build --no-prerender like it suggested) or use the non-stable next version of preact-cli.

@yishn yishn closed this as completed May 24, 2019
@golf-x
Copy link
Author

golf-x commented May 24, 2019

It seems like preact-cli doesn't support getDerivedStateFromProps during prerender yet. Either don't use prerender (by running preact build --no-prerender like it suggested) or use the non-stable next version of preact-cli.

I got issue about preact build --no-prerender before. it does work now.
Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants