Skip to content

[Bug] SSR (Gridsome) #1

Open
Open
@andrevandal

Description

@andrevandal

Hi, I'm using this lib with Gridsome and I've got this error:

6:35:42 PM: ReferenceError: window is not defined
6:35:42 PM:     at Object.b635 (node_modules/vue-resize-text/dist/vue-resize-text.common.js:210:0)
6:35:42 PM:     at __webpack_require__ (node_modules/vue-resize-text/dist/vue-resize-text.common.js:21:0)
6:35:42 PM:     at Module.fb15 (node_modules/vue-resize-text/dist/vue-resize-text.common.js:272:0)
6:35:42 PM:     at __webpack_require__ (node_modules/vue-resize-text/dist/vue-resize-text.common.js:21:0)
6:35:42 PM:     at exports.modules.315.module.exports.1eb2.i (node_modules/vue-resize-text/dist/vue-resize-text.common.js:85:0)
6:35:42 PM:     at Object.315 (node_modules/vue-resize-text/dist/vue-resize-text.common.js:88:0)
6:35:42 PM:     at __webpack_require__ (webpack/bootstrap:25:0)
6:35:42 PM:     at Module.368 (assets/js/page--src--pages--index-vue.a5043cb5.js:1352:30)
6:35:42 PM:     at __webpack_require__ (webpack/bootstrap:25:0)
6:35:42 PM: error Command failed with exit code 1.

This is how I'm using:

<template>
<ClientOnly>
  <h1
    class="text-center text-md-left flex-column mb-4 mx-auto w-100"
    v-resize-text="{ ratio: .8, maxFontSize: '60px' }"
    v-html="content"
  />
</ClientOnly>
</template>
<script>
import ResizeText from 'vue-resize-text'

export default {
  /* ... */
  directives: {
    ResizeText
  }
}
</script>

Cloud you help me?

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