typesafe-actions: "Can't find variable: n" error on react native production build
Description
When using the 4.2.1 version of the library in a react native project, the app crashes on launch with the production build, giving the error “Can’t find variable: n”. This only happens with the production build, not the development build.
Steps to Reproduce
- Create react native app with typescript support
- Add dependency on typesafe-actions 4.2.1
- Add a reducer making use of getType
- Execute the production build of the Android application
Expected behavior
The app starts without crashing.
Suggested solution(s)
The error does not occur with the 4.2.0 version, so it is probably the change related to stlib that causes it.
Project Dependencies
- Typesafe-Actions Version: 4.2.1
- TypeScript Version: 3.4.5
- tsconfig.json:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "react",
"module": "es6",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": true,
"target": "es6"
},
"exclude": ["node_modules"]
}
Environment (optional)
- React Native: 0.57.8
- OS: Android
- Node Version:
- Package Manager and Version: standard one for react native
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 18 (10 by maintainers)
Hey @marknelissen, I have just released a new version 4.4.0 which is using babel for code transformation to es5. I believe it should fix your issue, could you please confirm?