nuxt: Rollup error: Unexpected character '@'

Environment

npx nuxi info

Reproduction

npx nuxi info

Describe the bug

ERROR Importing directly from a nuxt.config file is not allowed. Instead, use runtime config or a module. [importing /nuxt.config.ts from index.html] 14:18:22

 ERROR  Importing directly from a nuxt.config file is not allowed. Instead, use runtime config or a module. [importing /nuxt.config.ts.cjs from index.html]                                               14:18:22

i Vite client warmed up in 1510ms                                                                                                                                                                         14:18:23

 ERROR  nuxt3/nuxt cannot be imported directly. Instead, import runtime Nuxt composables from #app or #imports. [importing nuxt from nuxt.config.ts]    

Additional context

No response

Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (3 by maintainers)

Most upvoted comments

The issue Rollup error: Unexpected character '@' is triggered by swiper/vue importing from a css file. Setting build.transpile to ['swiper'] in your nuxt.config should resolve it.

I suspect a very similar issue.