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

[Bug]: "getComputedStyle is not defined" using css experiment field set to true on SSR #8076

Open
JSMD-maintainers opened this issue Oct 9, 2024 · 0 comments
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@JSMD-maintainers
Copy link

System Info

System:
OS: macOS 14.6
CPU: (10) arm64 Apple M1 Pro
Memory: 218.47 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
npm: 10.8.3 - ~/.nvm/versions/node/v18.18.2/bin/npm
pnpm: 6.35.1 - ~/.nvm/versions/node/v18.18.2/bin/pnpm
bun: 1.1.12 - /opt/homebrew/bin/bun
Browsers:
Chrome: 129.0.6668.90
Safari: 17.6
npmPackages:
@rspack/cli: ^1.0.0 => 1.0.0
@rspack/core: ^1.0.0 => 1.0.0

Details

When using the native css support it seems that SSR is not working in the sense that the application is responding with an error:

// Error
{
"statusCode": 500,
"error": "Internal Server Error",
"message": "getComputedStyle is not defined"
}

I am following the this section of the docs: https://rspack.dev/guide/tech/css#sass

Expected behaviour:
Using css should not lead to an error. If you remove the css file and the css import in the App.jsx the app is running fine.

Reproduce link

https://github.com/MarcoLeko/rspack-can-not-read-property-of-undefined

Reproduce Steps

  1. Run npm ci
  2. Run npm run rspack:dev:server
  3. Check out: http://localhost:3001/
@JSMD-maintainers JSMD-maintainers added bug Something isn't working pending triage The issue/PR is currently untouched. labels Oct 9, 2024
@JSMD-maintainers JSMD-maintainers changed the title [Bug]: "getComputedStyle is not defined" using css experiment field set to true [Bug]: "getComputedStyle is not defined" using css experiment field set to true on SSR Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
Development

No branches or pull requests

1 participant