piotrwitek / typesafe-actions

Typesafe utilities for "action-creators" in Redux / Flux Architecture
https://codesandbox.io/s/github/piotrwitek/typesafe-actions/tree/master/codesandbox
MIT License
2.41k stars 99 forks source link

"Can't find variable: t" error on react native production build #169

Closed alexbeckwith closed 5 years ago

alexbeckwith commented 5 years ago

Description

Using expo/react-native with version 4.4.1, production builds produce the above error. Seems like the same thing as 151?

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create expo app via expo init {appname}
  2. yarn add typesafe-actions@4.4.1
  3. Create action creator with createStandardAction and a reducer using getType
  4. Run production build with expo r --no-dev

Project Dependencies

Environment (optional)

robertying commented 5 years ago

Confirmed it was introduced in 4.4.1, downgrading to 4.4.0 resolves the issue.

piotrwitek commented 5 years ago

I found the root issue. Rollup dependency introduced a breaking change between 1.13 => 1.14, so emitted bundle code is changed:

1.13:

function n(n, t) {
  return void 0 === t && (t = 1), null == n;
}

1.14:

function n(n, t) {
  return null == n;
}

I will downgrade and lock rollup dependency until further investigation and viable solution is found.