Production Build Error With React Navigation Stack
Quadriphobs1 opened this issue · 3 comments
Environment
React native 0.62.2
"@haul-bundler/babel-preset-react-native": "^0.16.0",
"@haul-bundler/cli": "^0.22.0",
"@haul-bundler/preset-0.60": "^0.18.0",
import {withPolyfills, makeConfig} from '@haul-bundler/preset-0.60';
export default makeConfig({
bundles: {
index: {
entry: withPolyfills('./index'),
looseMode: [/@react-native-community\/masked-view/],
},
},
});
Description
The webpack configuration deems to not work with the @react-navigation/stack this happens on android and ios
error ▶︎ Failed to compile.
error ▶︎ Error: project/node_modules/@haul-bundler/core/build/webpack/loaders/babelWorkerLoader/index.js??ref--5-0!/project/node_modules/@react-navigation/stack/src/index.tsx
RuntimeTemplate.moduleId(): Module project/node_modules/@haul-bundler/core/build/webpack/loaders/babelWorkerLoader/index.js??ref--5-0!project/node_modules/@react-navigation/stack/src/TransitionConfigs/CardStyleInterpolators.tsx has no id. This should not happen.
haul bundle --dev false --minify true --platform ios --bundle-output build/index.bundle --assets-dest build/assets
It works if bunldes in development mode, this has to do with webpack configuration
This looks like a Webpack issue, when assigning a id
for a module, especially that setting namedModules
and namedChunks
to true
fixes it.
Actually, the tools I checked before having to apply my custom webpack transforms, its caused by the sideEffects: true
so turning it to false
actually did solve, but added their other config to my satisfaction