Skip to content

document is not defined error when building with Gridsome Vue site generator #126

@somascope

Description

@somascope

I am using Gridsome for a project to create a static website, and have tried using the plyr component. Things work nicely in gridsome's "develop" mode ($gridsome develop), but once I try to build ($gridsome build), I receive a reference error.

the "/video/" reference in the error is the Vue component/page that I placed an insteance of vue-plyr onto.

Could not generate HTML for "/video/": ReferenceError: document is not defined at addStyle (node_modules/vue-plyr/dist/vue-plyr.mjs:159:0) at assets/js/app.08a6ebf4.js:41717:27 at a.__vue_inject_styles__ (node_modules/vue-plyr/dist/vue-plyr.mjs:204:0) at a.hook (node_modules/vue-plyr/dist/vue-plyr.mjs:114:0) at Ft (E:\Dev\gridsome-test4\node_modules\vue\dist\vue.runtime.common.prod.js:6:11191) at Ze (E:\Dev\gridsome-test4\node_modules\vue\dist\vue.runtime.common.prod.js:6:25133) at a.e._init (E:\Dev\gridsome-test4\node_modules\vue\dist\vue.runtime.common.prod.js:6:32564) at new a (E:\Dev\gridsome-test4\node_modules\vue\dist\vue.runtime.common.prod.js:6:30340) at Vi (E:\Dev\gridsome-test4\node_modules\vue-server-renderer\build.prod.js:1:66305) at io (E:\Dev\gridsome-test4\node_modules\vue-server-renderer\build.prod.js:1:70535)

I see four instances of "document" in the "vue-plyr.mjs" file, they seem to be related to setting the stylesheet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions