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

fix: play nice with server-side rendering #47

Merged
merged 1 commit into from
Apr 9, 2022

Conversation

chadoh
Copy link
Contributor

@chadoh chadoh commented Apr 6, 2022

When using server-side rendering tools like Gatsby or Next.js, atcb ends up being included in a NodeJS process. It can't assume that document is defined in these contexts.

This adds a new test which simply requires the file to see if it works. When this test was initially added, the require caused errors. These errors have now been fixed.

This also adds a GitHub Action to run the test, to make it easier to avoid breaking server-side rendering in the future.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the Readme.md.
  • I have updated the Readme.md accordingly.
  • I have read the CONTRIBUTING document.

When using server-side rendering tools like Gatsby or Next.js, atcb ends
up being included in a NodeJS process. It can't assume that `document`
is defined in these contexts.

This adds a new test which simply requires the file to see if it works.
When this test was initially added, the `require` caused errors. These
errors have now been fixed.

This also adds a GitHub Action to run the test, to make it easier to
avoid breaking server-side rendering in the future.
@jekuer jekuer merged commit 47d4a45 into add2cal:main Apr 9, 2022
@chadoh chadoh deleted the fix/node-env branch April 11, 2022 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants