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 compatibility #9

Open
hmaesta opened this issue Sep 24, 2020 · 6 comments
Open

Nuxt compatibility #9

hmaesta opened this issue Sep 24, 2020 · 6 comments

Comments

@hmaesta
Copy link

hmaesta commented Sep 24, 2020

Is vue-formulate-extended compatible with Nuxt SSR?

I am receiving Unexpected identifier just by placing VueFormulateExtended on VueFormulate plugins.

Codesandbox:
https://codesandbox.io/s/nuxt-vue-formulate-vue-formulate-extended-imask-89092

node_modules/vue-formulate-extended/lib/vue-formulate-extended.umd.js:1:173
node_modules/vue-formulate-extended/lib/vue-formulate-extended.umd.js:1:543
@gahabeen
Copy link
Owner

Hey @hmaesta, sorry for the delay. Been off-grid last week!
I'll have a look.

@gahabeen
Copy link
Owner

gahabeen commented Oct 6, 2020

I won't be able to tell as I haven't used it with Nuxt.
Maybe a mismatch in the peer dependencies as Vue is defined this way?

@CavalcanteLeo
Copy link

CavalcanteLeo commented Apr 15, 2021

I'm facing it now, any thought?

using

const VueFormulateExtended = require('vue-formulate-extended')
//or
import VueFormulateExtended from 'vue-formulate-extended'

returns this error:
Cannot use import statement outside a module

and I had to install imask separately
packages.json:

{
    "@braid/vue-formulate": "^2.5.2",
    "vue-formulate-extended": "^1.1.1",
    "imask": "^6.0.7",
}

full js plugin:

import { pt } from '@braid/vue-formulate-i18n'
import '../node_modules/@braid/vue-formulate/themes/snow/snow.scss'
const VueFormulateExtended = require('vue-formulate-extended')
// import VueFormulateExtended from 'vue-formulate-extended'

export default {
  plugins: [
    pt,
    VueFormulateExtended({
      features: {
        formEvents: true, // by-default
        textMask: false, // by-default
        enforceNumber: false, // by-default
      },
    }),
  ],
  locale: 'pt',
  classes: {
    outer(context) {
      switch (context.classification) {
        case 'button':
          return 'flex w-full justify-end'
        default:
          return 'mb-4 w-full'
      }
    },
    input(context) {
      switch (context.classification) {
        case 'button':
          return ' px-4 py-2 rounded bg-green-500 text-white hover:bg-green-600'
        default:
          return 'w-full px-3 py-2 rounded-lg border-2 border-gray-200 outline-none focus:border-primary-500'
      }
    },
    label: 'font-medium text-sm',
    help: 'text-xs mb-1 text-gray-600',
    error: 'text-red-700 text-xs mb-1 border-red-500',
  },
}

and nuxt.config.js

buildModules: [
    '@braid/vue-formulate/nuxt',
],

@CavalcanteLeo
Copy link

I also tried without buildModules, and installed as nuxt plugin, but got another error:

TypeError: o.shallowEqualObjects is not a function

Captura de Tela 2021-04-15 às 01 10 51

@minasvisual
Copy link

I also tried without buildModules, and installed as nuxt plugin, but got another error:

TypeError: o.shallowEqualObjects is not a function
Captura de Tela 2021-04-15 às 01 10 51

VueFormulate version 2.5 not support VFE current version yet. try downgrade VueFormulate. We are waiting admin accept the pull request with fixes.

@dzcpy
Copy link

dzcpy commented Jul 19, 2022

Any updates?

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

No branches or pull requests

5 participants