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

@emotion/server depends on through which doesn't work with Remix Oxygen runtime #3126

Open
guoyunhe opened this issue Nov 22, 2023 · 2 comments

Comments

@guoyunhe
Copy link

guoyunhe commented Nov 22, 2023

Current behavior:

@emotion/server throws error on Remix Oxygen runtime.

Error: Dynamic require of "stream" is not supported
    at file:///home/guo/git/material-ui/examples/material-ui-remix-ts/dist/worker/index.js?t=1700662329530.0657:11:9
    at node_modules/.pnpm/through@2.3.8/node_modules/through/index.js (file:///home/guo/git/material-ui/examples/material-ui-remix-ts/dist/worker/index.js?t=1700662329530.0657:30080:18)
    at file:///home/guo/git/material-ui/examples/material-ui-remix-ts/dist/worker/index.js?t=1700662329530.0657:17:50
    at node_modules/.pnpm/@emotion+server@11.11.0/node_modules/@emotion/server/create-instance/dist/emotion-server-create-instance.cjs.dev.js (file:///home/guo/git/material-ui/examples/material-ui-remix-ts/dist/worker/index.js?t=1700662329530.0657:32189:19)
    at file:///home/guo/git/material-ui/examples/material-ui-remix-ts/dist/worker/index.js?t=1700662329530.0657:17:50
    at node_modules/.pnpm/@emotion+server@11.11.0/node_modules/@emotion/server/create-instance/dist/emotion-server-create-instance.cjs.js (file:///home/guo/git/material-ui/examples/material-ui-remix-ts/dist/worker/index.js?t=1700662329530.0657:32293:22)
    at file:///home/guo/git/material-ui/examples/material-ui-remix-ts/dist/worker/index.js?t=1700662329530.0657:17:50
    at file:///home/guo/git/material-ui/examples/material-ui-remix-ts/dist/worker/index.js?t=1700662329530.0657:36725:57
    at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
    at ModuleLoader.import (node:internal/modules/esm/loader:316:24)

To reproduce:

https://github.com/guoyunhe/material-ui/tree/remix-oxygen

git clone git@github.com:guoyunhe/material-ui.git
cd material-ui/examples/material-ui-remix-ts
git checkout remix-oxygen
cp .env.example .env
npm install
npm run dev

Expected behavior:

Should work.

Environment information:

  • react version: 18.2.0
  • @emotion/react version: 1.11.1

See also mui/material-ui#39929

@lorenzo-del-rosario
Copy link

I'm having the same issue implementing createEmotionCache and createEmotionServer in the entry.server.tsx.

@guoyunhe have you found any solution?

@guoyunhe
Copy link
Author

@lorenzo-del-rosario no, I simply dropped emotion in the end...

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

No branches or pull requests

2 participants