release build is not working
Current Behavior
I'm currently facing some issue with the latest haul & react native in RELEASE BUILD. Please find the attached to understand the issue better.
I followed through the documentation and I managed to run the application in DEBUG BUILD. You can reproduce the issue here: https://github.com/lavaxun/haul-issue.
HOWEVER it's not working well in the release build. I changed the 'scheme' in xcode to be using 'Release' and clicked the 'Run'. Screenshot below shows the error. As you can see the build phase is using CLI_PATH. And it's giving a long list of errors when executing the bundling script during the build phase. (but the app can still be started despite of the build errors) When I try to use 'fetch' to perform HTTP POST. it shows me 'unsupported bodyinit type' error.
Another screenshot below shows the bundling script is working fine in the build phase. but without specifying CLI_PATH. And there is no problem in using 'fetch' to do HTTP POST.
Expected Behavior
The RELEASE build should be executed without errors. It should work just like the second screenshot above but with CLI_PATH.
Haul Configuration (haul.config.js)
import { createWebpackConfig } from "haul";
export default {
webpack: createWebpackConfig(({ platform }) => ({
entry: `./index.js`
}))
};
Your Environment
| software | version |
|---|---|
| Haul | 1.0.0-rc.9 |
| react-native | 0.57.2 |
| react-native-navigation | 1.1.491 |
| node | 8.11.4 |
| yarn | 1.10.1 |
+1
Hi, I'm facing the same issue as well with the latest React Native version and Haul on Android. I'm able to run release build but I get this unsupported BodyInit type error while debug mode is working properly.
+1
Would be great if somebody created a repo with a repro and investigate.
@thymikee I have made a repo here https://github.com/lavaxun/haul-issue. would be great if someone can help to investigate it.
do you have any idea on the issue after the initial investigation?
Did some quick hacks and managed to fix the issue here! https://github.com/lavaxun/haul/commit/f112dc0b832242856d2d65d20beb30b231fd971b
Hope someone can send a proper PR to fix this issue.
Context:
I suspect this has got to do with polyfill and hence started to zoom down to the src/utils/polyfillEnvironment.js.
Then I figured out there was a previous issue on the global fetch at https://github.com/callstack/haul/issues/146 And there is a PR https://github.com/callstack/haul/pull/74 addresses this problem.
I have made a PR https://github.com/callstack/haul/pull/494 to fix the issue by using webpack banner in production environment.