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

Reference error while fastboot testing #833

Closed
bobisjan opened this issue Mar 12, 2024 · 5 comments · Fixed by #834 or #835
Closed

Reference error while fastboot testing #833

bobisjan opened this issue Mar 12, 2024 · 5 comments · Fixed by #834 or #835

Comments

@bobisjan
Copy link

bobisjan commented Mar 12, 2024

When running tests using ember-cli-fastboot-testing the BasicDropdownWormholeComponent throws following error

Error occurred:

- While rendering:
  -top-level
    application
      BasicDropdownWormholeComponent


There was an error running your app in fastboot. More info about the error: 
 ReferenceError: document is not defined
    at BasicDropdownWormholeComponent.get getDestinationId

https://github.com/cibernox/ember-basic-dropdown/blob/master/ember-basic-dropdown/src/components/basic-dropdown-wormhole.ts#L24

It is easy to guard rendering while fastboot testing in application template, but should be this supported out-of-the-box? Thanks

@mkszepp
Copy link
Collaborator

mkszepp commented Mar 13, 2024

Hi @bobisjan thanks for reporting... i have added a check if document exists, so it should work while ember-cli-fastboot-testing

Edit: Fix is released in v8.0.2

@bobisjan
Copy link
Author

@mkszepp thanks for quick reply, I've tested with v8.0.2, but the error is still present 😢

The referenced PR uses !document, which throws the same error. Should the fix look something like typeof document === 'undefined' instead?

@mkszepp
Copy link
Collaborator

mkszepp commented Mar 13, 2024

@mkszepp thanks for quick reply, I've tested with v8.0.2, but the error is still present 😢

The referenced PR uses !document, which throws the same error. Should the fix look something like typeof document === 'undefined' instead?

ups... true... sry i fix it asap

@mkszepp
Copy link
Collaborator

mkszepp commented Mar 13, 2024

@bobisjan it should be fixed in v8.0.3. Let me know if it doesn't work (i have tested shortly with docs page and it seem that the check is now correct)

@bobisjan
Copy link
Author

@mkszepp tests are green 💚, thanks for the quick fix 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants