Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[React native] Compatibility issue of localforage #39

Closed
TakLee96 opened this issue Jul 26, 2016 · 6 comments
Closed

[React native] Compatibility issue of localforage #39

TakLee96 opened this issue Jul 26, 2016 · 6 comments
Assignees
Labels

Comments

@TakLee96
Copy link
Contributor

TakLee96 commented Jul 26, 2016

  • f070946 or also know as tag v0.13.0 (current npm stable release) is missing localStorage
  • 7bc2537 solves the above issue but is not published to npm yet
  • 5c18812 upgrades localforage (webpack no longer brings any error about localforage) but makes react-native projects crash

Step to reproduce the error:

  • npm install -g react-native-cli
  • react-native init BuggyProject (takes 5 minutes)
  • Edit package.json to include "skygear": "github:bensonby/skygear-SDK-JS-1#0.14-test-custom-build" inside dependencies
  • npm install
  • Edit index.ios.js to have import skygear from 'skygear' in the first line of code
  • react-native run-ios
transformed 681/682 (100%)[node-haste] Encountered an error while persisting cache:
> ReferenceError: Unknown plugin "add-module-exports" specified in "/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/localforage/.babelrc" at 0, attempted to resolve relative to "/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/localforage"
>     at /Users/lijiahang/Developer/oursky/BuggyProject/node_modules/babel-core/lib/transformation/file/options/option-manager.js:177:17
>     at Array.map (native)
>     at Function.normalisePlugins (/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/babel-core/lib/transformation/file/options/option-manager.js:153:20)
>     at OptionManager.mergeOptions (/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/babel-core/lib/transformation/file/options/option-manager.js:245:36)
>     at OptionManager.init (/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/babel-core/lib/transformation/file/options/option-manager.js:360:12)
>     at File.initOptions (/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/babel-core/lib/transformation/file/index.js:223:65)
>     at new File (/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/babel-core/lib/transformation/file/index.js:140:24)
>     at Pipeline.transform (/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
>     at transform (/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/react-native/packager/transformer.js:108:26)
> TransformError: /Users/lijiahang/Developer/oursky/BuggyProject/node_modules/localforage/dist/localforage.js: Unknown plugin "add-module-exports" specified in "/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/localforage/.babelrc" at 0, attempted to resolve relative to "/Users/lijiahang/Developer/oursky/BuggyProject/node_modules/localforage"

Localforage github repo has talked about installing additional dependencies for build systems, so I proceeded with installing the following (please also take a look at their .babelrc file):

  • npm install --save-dev babel-plugin-system-import-transformer
  • npm install --save-dev babel-plugin-add-module-exports
  • npm install --save-dev babel-preset-es2015
  • npm install --save-dev babel-preset-es2015-loose
  • react-native run-ios

Error

@bensonby
Copy link
Contributor

When finding ways to override the localforage in react-native environment:
facebook/react-native#6253

@bensonby
Copy link
Contributor

bensonby commented Jul 28, 2016

@rickmak
Copy link
Member

rickmak commented Aug 17, 2016

Let try to update to babel 6 to see will it resolve.

@cheungpat
Copy link
Contributor

Let try to update to babel 6 to see will it resolve.

now or later?

@cheungpat
Copy link
Contributor

now or later?

consensus is later

@royuen royuen changed the title Compatibility issue of localforage [React native] Compatibility issue of localforage Aug 22, 2016
@rickmak
Copy link
Member

rickmak commented Oct 25, 2016

Upgraded to use babel6, and trigger react-native issue: facebook/react-native#5747

Since the only variable is upgrade of babel and localforage. I suggest to drop localforage deps, to see if it relate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants