Open stevenbister opened 2 years ago
Possible solution?
The serverDependenciesToBundle option in the config doesn't seem to work with this package. And the rmx-cli doesn't pick it up as an ESM dependency :/
I have a fix in place with some steps needed to apply:
@theme-ui/mdx
as our own dependency (patch-package
won't work if it can't find it in our package.json)@theme-ui/mdx/dist/theme-ui-mdx.cjs.dev.js
& @theme-ui/mdx/dist/theme-ui-mdx.cjs.prod.js
filesrequire(...)
to import(...)
at the top of the filesnpx patch-package @theme-ui/mdx
to create a patch file (https://www.npmjs.com/package/patch-package)"postinstall": "patch-package"
to the package.json
npm i patch-package --save-dev
COPY patches/@theme-ui+mdx+0.14.7.patch /myapp/patches/@theme-ui+mdx+0.14.7.patch
to each Dockerfile to ensure the patch file gets included in the CI build~Requires testing in CI~
It looks as though theme-ui has it on their roadmap to fully support ESM/MDX which I imagine should fix this issue
Description
When installing
sanity-plugin-media
an error get's thrown by RemixLink to Reproduction
http://localhost:3000
Steps to reproduce
Install the
sanity-plugin-media
https://github.com/robinpyon/sanity-plugin-media/tree/v3-studio
Import and add the plugin to your
sanity.config.ts
fileRun
When you visit localhost you will be greeted with a similar error
Release Version
1.0.0
Browser
No response
Operating System
Additional Information
This appears to be an issue with Remix not liking the ES module in
@theme-ui/mdx
which is a dependency ofsanity-plugin-media
and doesn't seem to play nice with Remix