-
Notifications
You must be signed in to change notification settings - Fork 945
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
Import CSS in JSX throws exception - ReferenceError: 'document' is not defined #1261
Comments
I am having the same issue when importing a CSS module e.g. import styles from './news.module.scss'; ... ... An unhandled exception occurred while processing the request. JsRuntimeException: ReferenceError: document is not defined |
Same issue here. JsScriptException: Script threw an exception. JsRuntimeException: ReferenceError: 'document' is not defined ReactScriptLoadException: Error while loading "/dist/vendor.1b5e647d.js": ReferenceError: 'document' is not defined |
This is the relevant code where this happens when using Emotion for SSR rendering.
This code mentions SSR, so seems it should run on the server, but the ChakraCore won't have any |
I'm experiencing this issue as well and have not found a workaround. |
Thanks for filing a bug! To save time, if you're having trouble using the library, please check off the items you have tried. If you are just asking a question, skip right to the bottom.
Please verify these steps before filing an issue, and check them off as you go
JavaScriptEngineSwitcher.V8.Native.win-x64
)SetUseReact
andSetUseBabel
is correct inReactConfig.cs
orStartup.cs
I'm using these library versions:
ReactJS.NET
: 5.2JavaScriptEngineSwitcher
: V8react
andreact-dom
: 16.8.2webpack
: 5.46node
: v14.15.5--
Runtime environment:
Steps to reproduce
Exception is thrown:
ReferenceError: 'document' is not defined
Related to #1231
The desired outcome is to be able to define external component-specific css files that can be imported to JSX components.
The text was updated successfully, but these errors were encountered: