Create Next.js template or example #2016
Labels
core team
This issue should be done by an Excalibur core member
docs
Relating to documentation in any way
integrations
Issues that integrate with frameworks or other libraries
stale
This issue or PR has not had any activity recently
Here's an example of using Excalibur with Next. Since Excalibur can only execute on the client, it needs to be loaded via
useEffect
and a dynamic import otherwise Next will attempt to run the module in SSR. Unfortunately, right now we don't check forwindow
existence so it bombs in SSR.https://codesandbox.io/s/next-excalibur-5b18x?file=/game/game.js
FYI, this is still an issue in 0.24.5 which is exacerbated by HMR: #1431
Working around by clearing the element by tag name/query selector when effect runs.
Originally posted by @kamranayub in #1886 (comment)
The text was updated successfully, but these errors were encountered: