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

NextJS vanilla extract: Document not defined #4922

Closed
BengtHagemeister opened this issue Sep 29, 2023 · 2 comments
Closed

NextJS vanilla extract: Document not defined #4922

BengtHagemeister opened this issue Sep 29, 2023 · 2 comments

Comments

@BengtHagemeister
Copy link
Contributor

BengtHagemeister commented Sep 29, 2023

What package has an issue

@mantine/vanilla-extract

Describe the bug

When using mantine in combination with NextJS (pages) and vanilla extract, the following error is throwing:

./src/styles/Demo.css.js NonErrorEmittedError: (Emitted value instead of an instance of Error) ReferenceError: document is not defined

Similar (or the same??) issue is also described here: vanilla-extract-css/vanilla-extract#1043 (comment)

Reproducing the issue is possible by running the server and opening the start page.

What version of @mantine/* packages do you have in package.json? (Note that all @mantine/* packages must have the same version in order to work correctly)

7.1.0

If possible, please include a link to a codesandbox with the reproduced problem

https:/BengtHagemeister/mantine-next-vanilla-extract-document-bug

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Possible fix

No response

@rtivital
Copy link
Member

The issue, as you pointed out, is with Vanilla Extract, not Mantine, you can track the progress in Vanilla Extract repository. The fix for this issue cannot be implemented on Mantine side.

@tobysmith568
Copy link

tobysmith568 commented Oct 10, 2024

For those who are still finding this issue, I have found I can get around it by adding the Next.JS "app directory" to my project - even if I don't then use it.

See this reply to this thread

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

3 participants