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

Nuxt integration issue for plugin that needs window object #559

Open
iStuffs opened this issue Aug 25, 2022 · 0 comments
Open

Nuxt integration issue for plugin that needs window object #559

iStuffs opened this issue Aug 25, 2022 · 0 comments
Labels
bug report A submitted bug report, not yet validated.

Comments

@iStuffs
Copy link

iStuffs commented Aug 25, 2022

window is not defined js error with nuxt and plugins (example )

"nuxt": "^2.15.3",
"@braid/vue-formulate": "^2.5.3",
"@cone2875/vue-formulate-select": "^0.1.9",
"vue-select": "^3.20.0",

If you install vue-formulate for nuxt as documented

nuxt.config.js

  buildModules: [
    // https://vueformulate.com/guide/installation/#nuxt
    '@braid/vue-formulate/nuxt',
    ]

If you add the vue-formulate-select plugin

formulate.config.js

import FormulateVSelectPlugin from '@cone2875/vue-formulate-select'

export default {
  plugins: [FormulateVSelectPlugin]
}

you'll get a window is not defined js error

You may register vue-formulate nuxt plugin in client mode only

node_modules/@braid/vue-formulate/nuxt/index.js

  this.addPlugin({
    src: path.resolve(__dirname, 'plugin.js'),
    options: formulateOptions,
    mode: 'client'
  })
@iStuffs iStuffs added the bug report A submitted bug report, not yet validated. label Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report A submitted bug report, not yet validated.
Projects
None yet
Development

No branches or pull requests

1 participant