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

[BUG] "document is not defined" when deploying to Oxygen #1882

Closed
sebinievas opened this issue Jul 22, 2022 · 5 comments
Closed

[BUG] "document is not defined" when deploying to Oxygen #1882

sebinievas opened this issue Jul 22, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@sebinievas
Copy link

sebinievas commented Jul 22, 2022

Describe the bug
When deploying to Oxygen, the following error occurs:

InvalidScriptError: retrying will not succeed. The following error must be actioned:
Uncaught ReferenceError: document is not defined
  at line 0
Error: Process completed with exit code 1.

To Reproduce

Please contact me for access to private repo when working on issue. https://github.com/zoxllc/hydrogen-us

  1. Once you have access you can run yarn preview and it will load fine.
  2. Pushing the branch will trigger the workflow for Oxygen deployment, but it fails on the error message.

Expected behaviour
A successful deployment to Oxygen.

Screenshots
image

Additional context
I was able to successfully deploy to Vercel servers so this prompted the issue.

  • node 18.5.0
    "@shopify/cli": "3.3.2",
    "@shopify/cli-hydrogen": "3.3.2"
    "@shopify/hydrogen": "^1.1.0"
@sebinievas sebinievas added the bug Something isn't working label Jul 22, 2022
@sebinievas sebinievas changed the title [BUG] [BUG] "document is not defined" when deploying to Oxygen Jul 22, 2022
@sebinievas
Copy link
Author

I edited the description to include that I was able to deploy this successfully to Vercel servers.

@slester
Copy link
Contributor

slester commented Jul 25, 2022

@sebinievas If you provide me with access, I can have a look at the code. Does a clean Hydrogen checkout work?

@sebinievas
Copy link
Author

This ended up being an issue with importing a package that was not SSR ready I believe.

@sebinievas sebinievas closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2022
@elkelk
Copy link

elkelk commented Aug 31, 2022

This ended up being an issue with importing a package that was not SSR ready I believe.

@sebinievas can you provide more details about the issue and how you determined it was a package? I'm fighting a similar issue and we use a lot of dependencies.

@slester
Copy link
Contributor

slester commented Sep 1, 2022

@elkelk — We figured out this was a dependency mostly by just looking at some compilation errors we were having on Oxygen (running on a local instance) and looked through those issues on GitHub. We found others having the same sort of problem with the component rendered server-side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants