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

Create Next.js template or example #2016

Open
2 tasks
kamranayub opened this issue Sep 11, 2021 · 4 comments
Open
2 tasks

Create Next.js template or example #2016

kamranayub opened this issue Sep 11, 2021 · 4 comments
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

Comments

@kamranayub
Copy link
Member

kamranayub commented Sep 11, 2021

  • Formalize this from discussion, into new official repo
  • Add to templates and documentation

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 for window 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)

@kamranayub kamranayub added good first issue good for people new to open source and Excalibur 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 and removed good first issue good for people new to open source and Excalibur labels Sep 11, 2021
@jedeen jedeen added this to the vNext milestone Oct 9, 2021
@eonarheim
Copy link
Member

Should this issue be restructured to gracefully fail if no window is present?

@kamranayub
Copy link
Member Author

Well I think we'd still like a template or example, and then the other issue is failing gracefully with no window

@github-actions
Copy link

This issue hasn't had any recent activity lately and is being marked as stale automatically.

@github-actions github-actions bot added the stale This issue or PR has not had any activity recently label Jan 13, 2022
@eonarheim eonarheim removed this from the vNext milestone May 27, 2022
@github-actions github-actions bot removed the stale This issue or PR has not had any activity recently label Jan 16, 2023
@github-actions
Copy link

This issue hasn't had any recent activity lately and is being marked as stale automatically.

@github-actions github-actions bot added the stale This issue or PR has not had any activity recently label Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants