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
Coming from this thread, updating Onyx to the latest hash f11e7c1949916a81c36c17dd87919dd532d4620f results in the following console error on Web (native platforms seem to work).
Why is this important
We need to release new Onyx functionality that is blocking our roadmap.
includeModules is a list of modules we tell webpack to transpile, but since Onyx (browser) is already transpiled (has no import/export statements) it messes up Webpack
(This also means that for any Onyx update we should remember to run npm run build in order to update dist code)
(dist code is imported by Webpack due to the browser package.json field in Onyx)
(The PR here Expensify/react-native-onyx#133, didn't do so, so Onyx.update is not available in web)
Another option might be to go back to the react-native-onyx/web idea, because it'll still allow us to import react-native-onyx in App (web and native) and edit its source in node_modules, while other projects can import Onyx from react-native-onyx/web
Activity
luacmartins commentedon May 24, 2022
@kidroca I can't assign you, but would you mind working on this?
kidroca commentedon May 25, 2022
@luacmartins yes (You should be able to assign me after this comment)
kidroca commentedon May 25, 2022
Looks like we need to remove
'react-native-onyx'from the list of included modules here:App/config/webpack/webpack.common.js
Lines 10 to 22 in 8e3c67b
includeModulesis a list of modules we tell webpack to transpile, but since Onyx (browser) is already transpiled (has no import/export statements) it messes up Webpack(This also means that for any Onyx update we should remember to run
npm run buildin order to updatedistcode)(
distcode is imported by Webpack due to thebrowserpackage.json field in Onyx)(The PR here Expensify/react-native-onyx#133, didn't do so, so
Onyx.updateis not available inweb)Another option might be to go back to the
react-native-onyx/webidea, because it'll still allow us to importreact-native-onyxin App (web and native) and edit its source innode_modules, while other projects can import Onyx fromreact-native-onyx/webkidroca commentedon May 25, 2022
It seems we need to do 2 things
npm run buildin order to update the code indist, then merge that tomainreact-native-onyxfromincludeModulesand updates package.json with the latest Onyx hashluacmartins commentedon May 25, 2022
Both PRs are merged and this issue is fixed! I'll move the discussion about the other solutions back to Slack. Thanks @kidroca!