pimlie / nuxt-memwatch

Quickly watch real-time memory stats of your nuxt app
Other
88 stars 0 forks source link

How can I use in nuxt3? #2

Closed yusiny closed 1 year ago

yusiny commented 1 year ago

Hello, I'm currently use nuxt 3. I installed nuxt-memwatch and registered in nuxt.config.ts. But, Cannot start nuxt: Cannot start nuxt: Cannot read properties of undefined (reading 'options') at nuxtMemwatch (~~/node_modules/nuxt-memwatch/lib/module.js:11:12). I think that the problem is this.options, this.nuxt is undefined, and maybe related with the version of nuxt. Can you give me any guide for this?

My package.json:

 "devDependencies": {
    "@invictus.codes/nuxt-vuetify": "^0.2.17",
    "@nuxt/devtools": "^0.6.1",
    "@nuxtjs/eslint-config-typescript": "^12.0.0",
    "@types/node": "^18",
    "@typescript-eslint/eslint-plugin": "^5.57.1",
    "@typescript-eslint/parser": "^5.57.1",
    "eslint": "^8.37.0",
    "eslint-config-prettier": "^8.8.0",
    "eslint-plugin-nuxt": "^4.0.0",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-vue": "^9.10.0",
    "nuxt": "^3.5.0",
    "nuxt-gtag": "^0.5.7",
    "prettier": "^2.8.7",
    "sass": "^1.62.0",
    "sass-loader": "^13.2.2",
    "typescript": "^5.0.4",
    "vite-plugin-eslint": "^1.8.1"
  },
  "dependencies": {
    "@ckeditor/ckeditor5-build-classic": "^38.1.1",
    "@ckeditor/ckeditor5-vue": "^5.1.0",
    "@ffmpeg-installer/ffmpeg": "^1.1.0",
    "@nuxtjs/dotenv": "^1.4.1",
    "@pinia/nuxt": "^0.4.9",
    "@sendbird/chat": "^4.7.2",
    "@vuepic/vue-datepicker": "^4.4.0",
    "ckeditor5-custom-build": "file:./ckeditor5",
    "compressorjs": "^1.2.1",
    "date-fns": "^2.29.3",
    "dayjs": "^1.11.7",
    "firebase": "^9.22.1",
    "fluent-ffmpeg": "^2.1.2",
    "image-map": "^2.0.1",
    "js-cookie": "^3.0.5",
    "mitt": "^3.0.0",
    "multer": "^1.4.5-lts.1",
    "nuxt-memwatch": "^0.1.2",
    "nuxt-simple-sitemap": "^2.7.0",
    "nuxt-swiper": "^1.1.0",
    "pinia": "^2.0.35",
    "sharp": "^0.32.1",
    "v3-infinite-loading": "^1.2.2",
    "vue-dompurify-html": "^4.1.4",
    "vuedraggable": "^4.1.0"
  },

My nuxt.config.ts

modules: ["nuxt-swiper", "@pinia/nuxt", "@invictus.codes/nuxt-vuetify", "nuxt-simple-sitemap", "nuxt-gtag", "nuxt-memwatch"],

And the error:

 ERROR  Cannot restart nuxt:  Cannot read properties of undefined (reading 'options')                                                                                                                                    오후 2:52:07  

  at nuxtMemwatch (/~~~/node_modules/nuxt-memwatch/lib/module.js:11:12)
  at installModule (/~~~/node_modules/@nuxt/kit/dist/index.mjs:2407:101)
  at async initNuxt (/~~~/node_modules/nuxt/dist/index.mjs:2928:7)
  at async load (/~~~/node_modules/nuxi/dist/chunks/dev.mjs:204:9)
  at async _applyPromised (/~~~/node_modules/nuxi/dist/chunks/dev.mjs:96:10)
ideafm commented 2 months ago

@yusiny how did you solve this?