logaretm / vee-validate

✅ Painless Vue forms
https://vee-validate.logaretm.com/v4
MIT License
10.77k stars 1.26k forks source link

Problems when using with NuxtJS #3585

Closed rdmchr closed 2 years ago

rdmchr commented 2 years ago

What happened?

When using VeeValidate with NuxtJs 3 I get the following error:

(node:2876) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)

I followed the instructions and updated my package.json:

{
  "private": true,
  "type": "module",
  "scripts": {
    "dev": "nuxi dev",
    "build": "nuxi build",
    "start": "node .output/server/index.mjs"
  },
  "devDependencies": {
    "nuxt-windicss": "^2.0.12",
    "nuxt3": "latest"
  },
  "dependencies": {
    "vee-validate": "^4.5.5",
    "yup": "^0.32.11"
  }
}

But the error persistent.

Reproduction steps

  1. Create a new NuxtJs 3 project
  2. Install VeeValidate (optionally with yup)
  3. Set up some validation
  4. See error when visiting the page

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

Relevant log output

(node:12712) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)

Demo link

https://github.com/GetDaphne/Daphne

Code of Conduct

logaretm commented 2 years ago

Upgrading to the latest nuxt version seems to fix this.

However even after upgrading this issue happens Which hardly outputs any useful errors to work with.

Since there is nothing for me to do here, I will close the issue until that one is fixed so we can test again.