realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Expo Web support

Open riebel opened this issue 1 year ago • 9 comments

Problem

I know the web context of Expo is not officially supported, but since Hermes is now supported and the default engine in Expo SDK 48 also switched to Hermes, maybe it is now somehow possible?

I get it running on Expo48 Android dev client, but when i try to bundle for web, I get:

The package at "node_modules\bindings\bindings.js" attempted to import the Node standard library module "fs".
It failed because the native React runtime does not include the Node standard library.

Maybe there is a workaround or fix for this or is it just plain impossible at the moment?

Solution

No response

Alternatives

No response

How important is this improvement for you?

Dealbreaker

Feature would mainly be used with

Atlas Device Sync

riebel avatar Mar 03 '23 10:03 riebel

@riebel Thank you for reporting. It is not something we have tried out. You might be able to find a work-around by tweaking your Babel configuration: https://github.com/goatandsheep/react-native-dotenv/issues/78

kneth avatar Mar 06 '23 10:03 kneth

I tried to modify my babel.config.js with no success:

module.exports = function (api) {
  api.cache(true)
  return {
    presets: ['babel-preset-expo', 'module:metro-react-native-babel-preset'],
    plugins: [
      '@babel/plugin-proposal-export-namespace-from',
      'react-native-reanimated/plugin',
      require.resolve('expo-router/babel')
    ]
  }
}

riebel avatar Mar 06 '23 11:03 riebel

It is not on our current roadmap to support Expo Web but in general web is an interesting platform. I am curious to learn more about your use case? Do you want to share an app between mobile and web? Are you interested in developing your mobile app as a PWA?

kneth avatar Mar 09 '23 17:03 kneth

Yes, I share the whole codebase with android, iOs and web and the same app runs flawlessly on all three platforms. I plan to switch from firebase to a self-hosted solution, but I think it is impractical for my project to use different APIs for web and for mobile. It would require a lot of duplicated code and/or a weird wrapper API.

riebel avatar Mar 09 '23 18:03 riebel

@riebel Did you find any work around?

federicogomezlara avatar Aug 08 '23 09:08 federicogomezlara

@federicogomezlara sadly not.

riebel avatar Aug 08 '23 15:08 riebel

I'm having the same issue.

aronkramer avatar Oct 17 '23 07:10 aronkramer

same

farynaio avatar May 19 '24 17:05 farynaio

+1

Arthurmtro avatar May 27 '24 23:05 Arthurmtro