After digging several hours we decided to come up with a question on SO, hoping that someone else could help regarding the following problem.
What we found so far: it seems that on our staging environment, some HTML attributes are set differently into the DOM:
|----------------|---------------|--------------|
| HTML attribute | DEV ENV | STAGING ENV |
|----------------|---------------|--------------|
| fixed-content | fixed-content | fixedcontent |
|----------------|---------------|--------------|
| active-index | active-index | index |
|----------------|---------------|--------------|
Because of this, the Onsen framework cannot find the attributes on the HTML Elements and behaves differently regardless that:
What differences are between envs:
gzip, deflate
on local and gzip, deflate, br
on stagingDoes anybody know what the hell is happening here?
We actually found the problem and the solution is quite simple even though it took us hours to find it.
On our staging/production environments, we use the babel plugin transform-react-remove-prop-types
to strip the React prop types.
Unfortunately, the Onsen UI React support library relies on its components' defined prop types, so when they were stripped the library started to behave differently.
What we did:
0.3.3
in order to be able to use the ignoreFilenames
optionWe skipped the file which holds the code of the Onsen UI React library
if (cli.production) {
config.babel.plugins.push([
'transform-react-remove-prop-types',
{
ignoreFilenames: ['projectleader']
}
]);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With