You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When implement the SSR cache I receive some errors saying Could not resolve "events" and Could not resolve "stream" :
I try to change serverPlatform to 'node' in remix.config.js and I receive a new error:
I then revert serverPlatform value to the default 'neutral' and try to address the missing node modules issue with polyfill by adding the missing modules in serverNodeBuiltinsPolyfill inside of remix.config.js
VMScriptRunnerError [ERR_MODULE_STRING_SCRIPT]: Unable to resolve "<script>" dependency "node:buffer": imports unsupported with string script
at linker (/Users/lorenzo/projects/store/node_modules/.pnpm/@miniflare+runner-vm@2.14.1/node_modules/@miniflare/runner-vm/src/linker.ts:62:13)
at ModuleWrap.<anonymous> (node:internal/vm/module:315:30)
at SourceTextModule.<computed> (node:internal/vm/module:314:36)
at SourceTextModule.link (node:internal/vm/module:199:22)
at VMScriptRunner.runAsModule (/Users/lorenzo/projects/store/node_modules/.pnpm/@miniflare+runner-vm@2.14.1/node_modules/@miniflare/runner-vm/src/index.ts:39:18)
at VMScriptRunner.run (/Users/lorenzo/projects/store/node_modules/.pnpm/@miniflare+runner-vm@2.14.1/node_modules/@miniflare/runner-vm/src/index.ts:86:28)
at MiniOxygen.#reload (/Users/lorenzo/projects/store/node_modules/.pnpm/@miniflare+core@2.14.1/node_modules/@miniflare/core/src/index.ts:793:42)
I'm now stuck as I don't know how to solve this issue and I'm not sure if MUI can correctly be implemented on a Hydrogen app.
ERR_MODULE_STRING_SCRIPT: : Unable to resolve "<script>" dependency "node:buffer": imports unsupported with string script
Seems like there are compatibility issues with MUI and @miniflare used by @shopify/mini-oxygen@2.2.4.
Emotion is a known library that is made for Node.js and has issues with workers. I'd recommend following emotion-js/emotion#2446 for more information.
Someone there made a vendored version of their dependencies and it seem like it worked for them.
frandiox
changed the title
packages/mini-oxygen prevents the implementation of MUI.
MUI / Emotion not compatible with Oxygen worker runtime
Jan 23, 2024
What is the location of your example repository?
No response
Which package or tool is having this issue?
Hydrogen
What version of that package or tool are you using?
2023.10.2
What version of Remix are you using?
2.1.0
Steps to Reproduce
I'm trying to implement MUI in an Hydrogen app.
The company uses a shared design system based on MUI.
MUI (like other UI libraries that generate dynamic classes) has to be implemented on the server to avoid the
Prop className did not match
issue.This is the MUI SSR implementation:
Could not resolve "events"
andCould not resolve "stream"
:serverPlatform
to'node'
inremix.config.js
and I receive a new error:serverPlatform
value to the default'neutral'
and try to address the missing node modules issue with polyfill by adding the missing modules inserverNodeBuiltinsPolyfill
inside ofremix.config.js
Now I'm facing a new error, in the browser I see this:
Buffer
to the polyfill:I see this error in the browser:
I'm now stuck as I don't know how to solve this issue and I'm not sure if MUI can correctly be implemented on a Hydrogen app.
Expected Behavior
I'd expect to be able to implement Material UI as per standard SSR implementation.
Actual Behavior
ERR_MODULE_STRING_SCRIPT: : Unable to resolve "<script>" dependency "node:buffer": imports unsupported with string script
Seems like there are compatibility issues with MUI and
@miniflare
used by@shopify/mini-oxygen@2.2.4
.See also mui/material-ui#39929
The text was updated successfully, but these errors were encountered: