Skip to content

[ERROR] document is not defined #568

@Niko7133

Description

@Niko7133

Hi guys, I'm trying to use Locomotive-scroll with astro, but I'm having big problems, despite having a maximally clean environment and very basic code, I'm getting this error

16:52:09 [ERROR] document is not defined
  Hint:
    Browser APIs are not available on the server.
    
    If the code is in a framework component, try to access these objects after rendering using lifecycle methods or use a "client:only" directive to make the component exclusively run on the client.
    
    See https://docs.astro.build/en/guides/troubleshooting/#document-or-window-is-not-defined for more information.
    
  Stack trace:
    at /Applications/MAMP/htdocs/Developer/Git/Bitozzi-Scale/node_modules/locomotive-scroll/dist/locomotive-scroll.js:261:9
    [...] See full stack trace in the browser, or rerun with --verbose.

I have been looking for the solution for 2 hours, can anyone help me? Pls don't insult me I'm a beginner :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions