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 : TransformError with babel-plugin-add-module-exports #171

Closed
Freddy03h opened this Issue Jun 29, 2017 · 7 comments

Comments

Projects
None yet
6 participants
@Freddy03h
Copy link

commented Jun 29, 2017

Hello,

Fuse does'nt work with React Native since 3.X

Importing Fuse in a react-native projet causes an issue with babel-plugin-add-module-exports :

TransformError: […]/node_modules/fuse.js/dist/fuse.js: Unknown plugin "babel-plugin-add-module-exports" specified in "[…]/node_modules/fuse.js/.babelrc" at 0, attempted to resolve relative to "[…]/node_modules/fuse.js"

Is there an extra step to do on a react-native project ?
Thank's

@Freddy03h Freddy03h changed the title React Native - babel-plugin-add-module-exports React Native : TransformError with babel-plugin-add-module-exports Jun 29, 2017

@Noitidart

This comment has been minimized.

Copy link

commented Jul 10, 2017

I am having this same issue. I am trying to import/require it in all kinds of ways. I am also using this in a react-native project.

I tried the following ways:

const Fuse = require('fuse.js/dist/fuse.js');
const Fuse = require('fuse.js/src');
const Fuse = require('fuse.js');
import Fuse from 'fuse.js'
import Fuse from 'fuse.js/src'
import Fuse from 'fuse.js/dist/fuse'
@Noitidart

This comment has been minimized.

Copy link

commented Jul 10, 2017

What I did was copy the the src dir from node_modules/fuse.js/src and pasted it into my ./app/ dir but renamed it to fuse. So from ./node_modules/fuse.js/src to ./app/fuse and then I import it like this:

const Fuse = require('./fuse');

Its a workaround for now.

thatmarvin added a commit to Frameio/Fuse that referenced this issue Jul 11, 2017

@krisk krisk closed this in 9d4351b Jul 12, 2017

@Noitidart

This comment has been minimized.

Copy link

commented Jul 13, 2017

Thank you @krisk for such a fast fix! I didn't test it yet but will sure do so soon :)

@ismaeldcom

This comment has been minimized.

Copy link

commented Jul 19, 2017

The last version available in npm 3.0.5 doesn't have .babelrc in .npmignore file yet.

Thanks @krisk for your amazing work with fuse.

@meriadec

This comment has been minimized.

Copy link

commented Aug 22, 2017

Hey there, following the discussion, @krisk would you mind publish a release to npm?
Thanks in advance!

@defualt

This comment has been minimized.

Copy link

commented Feb 22, 2018

try import Fuse from 'fuse.js/src';

@KasparasGud

This comment has been minimized.

Copy link

commented Jun 21, 2018

@defualt Solution worked for me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.