nuxt: Duplicated imports "definePageMeta" the one from "[app_root]/node_modules/nuxt3/dist/pages/runtime/composables" has been ignored.

After a fresh install I keep getting this warning in the nuxi dev command console every time I save a file.

Environment

  • Operating System: Linux
  • Node Version: v16.13.1
  • Nuxt Version: 3.0.0-27459267.f69126e
  • Package Manager: yarn@1.22.17
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Steps to reproduce:

yarn nuxi init nuxt3-app
cd nuxt3-app
yarn install
yarn dev -o

Then I delete the app.vue file. Edit the nuxt.config.ts:

import { defineNuxtConfig } from 'nuxt3'
export default defineNuxtConfig({
	srcDir: './src'
})

Create the directory ./src. Create the directory ./src/pages. Create the file ./src/pages/index.ts.

Describe the bug

And I get the Warning:

Duplicated imports "definePageMeta" the one from "[app_root]/node_modules/nuxt3/dist/pages/runtime/composables" has been ignored.

How can this be fixed?

Additional context

No response

Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 10
  • Comments: 22 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Each time I save a file and it renders, it rewrites the file and adds another definePageMeta. This is any example of saving a file 3 times.

.nuxt/imports.d.ts

export { definePageMeta, definePageMeta, definePageMeta, definePageMeta } from 'xxxx/node_modules/nuxt/dist/pages/runtime/composables';

I’m having the same issue by saving a file inside compososables directory while running on dev mode

I’ve also started seeing duplicated imports logs coming since 3.7.3

Seems connected to this issue.

Locking unimport to 3.2.0 seems to work for now.

  "resolutions": {
    "unimport": "3.2.0"
  }

@lucassimines thank you very much Lucas! it works!

@Harkonnen13 I changed my nuxt version to "nuxt": "npm:nuxt3@latest" and this issue no longer exists

After the update, it has moved to the console on the browser - Uncaught SyntaxError: Duplicate export of ‘definePageMeta’ (at imports.mjs:5:26).