Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with QWIK v1.9.1: document is not defined #31

Open
AlreNux opened this issue Oct 23, 2024 · 0 comments
Open

Crash with QWIK v1.9.1: document is not defined #31

AlreNux opened this issue Oct 23, 2024 · 0 comments

Comments

@AlreNux
Copy link

AlreNux commented Oct 23, 2024

An error occurs when viewing the “styled-flower” page:

[vite] Internal server error: document is not defined
      at Module.injectStyles (C:\Users\Spell\Desktop\test-qwik-vanilla\node_modules\@vanilla-extract\css\injectStyles\dist\vanilla-extract-css-injectStyles.cjs.dev.js:14:19)
      at inject (C:\Users\Spell\Desktop\test-qwik-vanilla\src\routes\styled-flower\flower.css.ts.vanilla.js:3:25)
      at C:\Users\Spell\Desktop\test-qwik-vanilla\src\routes\styled-flower\flower.css.ts.vanilla.js:8:1
      at async instantiateModule (file:///C:/Users/Spell/Desktop/test-qwik-vanilla/node_modules/vite/dist/node/chunks/dep-mCdpKltl.js:52650:5)

How to repeat:

  1. Initiate the project using the “bun create qwik” command
  2. Install “bun install” dependencies
  3. Install “styled-vanilla-extract” library via “bun run qwik add styled-vanilla-extract” command

File Contents:
There is no provision for any modifications made by hand.

vite.config.ts

import { vanillaExtractPlugin } from "styled-vanilla-extract/vite";
...
plugins: [qwikCity(), qwikVite(), tsconfigPaths(), vanillaExtractPlugin()],

Error screenshot:
image

Repository screenshot:
image

P.S.
If you put another vanilla-extract plugin for vite - “@vanilla-extract/vite-plugin”, this error disappears
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant