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

Impossible to run sanity-plugin-r2-files using Bun #19

Open
flayks opened this issue Oct 28, 2024 · 1 comment
Open

Impossible to run sanity-plugin-r2-files using Bun #19

flayks opened this issue Oct 28, 2024 · 1 comment

Comments

@flayks
Copy link

flayks commented Oct 28, 2024

I was waiting for this plugin a long time! Thank you so much for the hard work 🙏

Finally tried to use it on my Sanity setup using Bun (v1.1.33) but I get this error when launching the Studio (followed by this console error "Failed to load resource: the server responded with a status of 504 (Outdated Optimize Dep)"):

$ sanity dev
✅ Checking configuration files...
Sanity Studio using [email protected] ready in 1058ms and running at http://localhost:3333/
✘ [ERROR] No matching export in "node_modules/xstate/dist/xstate.development.esm.js" for import "InterpreterStatus"

    node_modules/@xstate/react/es/useInterpret.js:41:20:
      41 │ import { interpret, InterpreterStatus, State, toObserver } from 'xstate';
         ╵                     ~~~~~~~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/xstate/dist/xstate.development.esm.js" for import "State"

    node_modules/@xstate/react/es/useInterpret.js:41:39:
      41 │ import { interpret, InterpreterStatus, State, toObserver } from 'xstate';
         ╵                                        ~~~~~

✘ [ERROR] No matching export in "node_modules/xstate/dist/xstate.development.esm.js" for import "InterpreterStatus"

    node_modules/@xstate/react/es/utils.js:28:9:
      28 │ import { InterpreterStatus } from 'xstate';
         ╵          ~~~~~~~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/xstate/dist/xstate.development.esm.js" for import "InterpreterStatus"

    node_modules/@xstate/react/es/useMachine.js:19:9:
      19 │ import { InterpreterStatus, State } from 'xstate';
         ╵          ~~~~~~~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/xstate/dist/xstate.development.esm.js" for import "State"

    node_modules/@xstate/react/es/useMachine.js:19:28:
      19 │ import { InterpreterStatus, State } from 'xstate';
         ╵                             ~~~~~

✘ [ERROR] No matching export in "node_modules/xstate/dist/xstate.development.esm.js" for import "spawnBehavior"

    node_modules/@xstate/react/es/useSpawn.js:1:9:
      1 │ import { spawnBehavior } from 'xstate';
        ╵          ~~~~~~~~~~~~~

Having tried with a monorepo setup and a simple sanity init project, I feel that the plugin is not totally optimized to be used with Bun. Only works when I tried installing it with npm on the clean Sanity install. The thing is that my usual setup is using Bun workspaces so I cannot both use bun and npm.

Not sure what needs to be fixed but here are my 2 cents 🙈

Tagging @emilianscheel for visibility

@flayks flayks changed the title Impossible to run using Bun Impossible to run sanity-plugin-r2-files using Bun Oct 28, 2024
@flayks
Copy link
Author

flayks commented Oct 28, 2024

Self-diagnose (with a little help from Claude):
Installing these to my Sanity package.json helps and I can run the Studio using Bun. Something to do with xstate versions?

bun add xstate@latest @xstate/react@latest

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

No branches or pull requests

1 participant