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.

Nuxtjs 3 + vanilla extract build error

See original GitHub issue

Describe the bug

Nuxt 3 beta has been released and I was trying to use vanilla-extrat with it. I installed the vite plugin and added it to the nuxt.config.ts file. After running yarn dev I get this error:

some_folder/node_modules/@vanilla-extract/css/fileScope/dist/vanilla-extract-css-fileScope.esm.js:1
import outdent from 'outdent';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:988:16)
    at Module._compile (internal/modules/cjs/loader.js:1036:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
    at ModuleJob.run (internal/modules/esm/module_job.js:170:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async __instantiateModule__ (file://some_folder/.nuxt/dist/server/server.mjs:2319:3)

Let me know if there is any more information I can give you.

Link to reproduction

https://codesandbox.io/s/nuxt3-vanilla-extract-cpfce

System Info

Output of npx envinfo --system --npmPackages @vanilla-extract/css,@vanilla-extract/webpack-plugin,@vanilla-extract/esbuild-plugin,@vanilla-extract/vite-plugin,@vanilla-extract/sprinkles,webpack,esbuild,vite --binaries --browsers:

  System:
    OS: Linux 5.11 Ubuntu 21.04 (Hirsute Hippo)
    CPU: (6) x64 Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz
    Memory: 3.24 GB / 15.57 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 14.17.6 - /tmp/fnm_multishells/1605_1634115304080/bin/node
    Yarn: 1.22.11 - /tmp/fnm_multishells/1605_1634115304080/bin/yarn
    npm: 6.14.15 - /tmp/fnm_multishells/1605_1634115304080/bin/npm
  Browsers:
    Chrome: 94.0.4606.81
    Firefox: 93.0
  npmPackages:
    @vanilla-extract/css: ^1.6.2 => 1.6.2
    @vanilla-extract/vite-plugin: ^2.1.3 => 2.1.3

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
mattcompilescommented, Oct 14, 2021

This looks related to the following nuxt issue. https://github.com/nuxt/framework/issues/858

1reaction
leithonenglishcommented, May 6, 2022

No updates on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxtjs 3 + vanilla extract build error · Issue #413 - GitHub
Describe the bug Nuxt 3 beta has been released and I was trying to use vanilla-extrat with it. I installed the vite plugin...
Read more >
Tkofh - Nuxt3 Vanilla Extract Ssr Error (forked) - StackBlitz
Run Nuxt3 Vanilla Extract Ssr Error created by Tkofh on StackBlitz.
Read more >
NuxtJS Distributed Static Page Generation - Stack Overflow
1 Answer 1 ... If you're already using the payload key, then I guess that you're at the max possible capabilities of vanilla...
Read more >
The build Property - Nuxt
There is a workaround for this: It is not recommended to extract everything into a single file.
Read more >
Tips You Must Know to Build Vue.js Projects with Nuxt.js
It must be in a folder to offer a better directory structure that could prevent errors generating some repeated routing name. And the...
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