question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rollup error: Unexpected character '@'

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danielroecommented, May 6, 2022

I suspect a very similar issue.

1reaction
danielroecommented, May 6, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected character '@' (Note that you need plugins to ...
I was having the same issue with importing css file, the error was [!] Error: Unexpected character '@' (Note that you need plugins...
Read more >
@rollup/plugin-typescript - npm
Seamless integration between Rollup and TypeScript.. Latest version: 10.0.1, last published: a month ago.
Read more >
How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Learn how to use Rollup as a smaller, more efficient alternative to webpack and Browserify to bundle JavaScript files in this step-by-step tutorial...
Read more >
rollup打包报错:error: Unexpected “<“_丸子CC的博客
[!] Error: Unexpected character '@' (Note that you need plugins to import files that are not JavaScript) styles\index.scss (1:0) ...
Read more >
@rollup/plugin-typescript - npm package | Snyk
Learn more about @rollup/plugin-typescript: package health score, ... Error: Unexpected token (Note that you need plugins to import files that are not ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found