ERROR nuxt.plugin('build',..) is not supported. Use new hooks system. - Fresh Install

andrade1379
38
andrade1379
commented 2 years ago

I just did a fresh install of the Nuxtent template:

vue init nuxt-community/nuxtent-template my-site
yarn run install

My package.json file looks like:

{
  "name": "sample-site",
  "version": "1.0.0",
  "description": "Nuxt.js Content Site",
  "author": "",
  "private": true,
  "dependencies": {
    "@nuxtjs/axios": "^4.5.2",
    "nuxt": "^1.1.1",
    "nuxtent": "^1.2.2"
  },
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
    "deploy": "push-dir --dir=dist --branch=gh-pages --cleanup",
    "precommit": "npm run lint"
  },
  "devDependencies": {
    "babel-eslint": "^7.1.1",
    "eslint": "^3.15.0",
    "eslint-config-standard": "^6.2.1",
    "eslint-loader": "^1.6.1",
    "eslint-plugin-html": "^2.0.0",
    "eslint-plugin-promise": "^3.4.1",
    "eslint-plugin-standard": "^2.0.1"
  }
}

When running yarn run dev I get an error that reads:

 ERROR  Nuxt error

  Error: nuxt.plugin('build',..) is not supported. Use new hooks system.

  - nuxt.js:88 Nuxt.plugin
    [sample-site]/[nuxt]/lib/core/nuxt.js:88:13

  - module.js:1 ModuleContainer.ContentModule
    [sample-site]/[nuxtent]/dist/module.js:1:4430

  - module.js:155 Promise
    [sample-site]/[nuxt]/lib/core/module.js:155:30

  - new Promise

  - module.js:139 ModuleContainer.addModule
    [sample-site]/[nuxt]/lib/core/module.js:139:12

  - utils.js:96 promise.then
    [sample-site]/[nuxt]/lib/common/utils.js:96:43


  - next_tick.js:160 process._tickCallback
    internal/process/next_tick.js:160:7

  - module.js:703 Function.Module.runMain
    module.js:703:11

  - bootstrap_node.js:194 startup
    bootstrap_node.js:194:16

  - bootstrap_node.js:618
    bootstrap_node.js:618:3

and my nuxt.config.js file looks like:

module.exports = {
  head: {
    title: 'Nuxtent Starter',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: 'Nuxtent project' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },
  build: {
    extend (config, ctx) {
      if (ctx.isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  },
  modules: [
    ['nuxtent']
  ],
  loading: { color: '#3B8070' }
}

I'm assuming this has something to do with the @nuxtjs/axios module perhaps?

6
alidcastano
1.7k
alidcastano
commented 2 years ago

Plugin still needs to be upgraded to v1 of nuxt

0
andrade1379
38
andrade1379
commented 2 years ago

@alidcastano thank you for your quick response ๐Ÿ‘

0
coderdiaz
5
coderdiaz
commented 2 years ago

Same problem

+1

1
magick93
0
magick93
commented 2 years ago

Same problem.

For the newbies in the audience, how do we solve this?

0
clementfox
20
clementfox
commented 2 years ago

@magick93 You can try to uninstall Nuxt and reinstall it with the 1.0.0-rc11 version for example

4
john-cheesman
20
john-cheesman
commented 2 years ago

I've just tried a fresh install, which gave me [email protected] and I'm still getting the error.

4
Daniil-Sokolov
10
Daniil-Sokolov
commented 2 years ago

@magick93 Thank you dude, really helped
open terminal in the project directory and enter these commands:

  1. # npm uninstall nuxt
  2. # npm install [email protected]
    and problem fixed
2
joostdecock
230
joostdecock
commented a year ago

Do you have plans to upgrade this plugin to the hooks system?

I'm looking to replace a Jekyll site with this, but only if it's maintained.

I'd help if I knew how to

0
alidcastano
1.7k
alidcastano
commented a year ago

[email protected] should be compatible with nuxt 1.0 now

1
Informations
Question โ€ข Unresolved
#c110 - Created 2 years ago