Giter Club home page Giter Club logo

Comments (10)

njt1982 avatar njt1982 commented on June 9, 2024

yarn add babel-plugin-transform-replace-object-assign -- this did not resolve the error either.

from rheostat.

njt1982 avatar njt1982 commented on June 9, 2024

After adding the plugin, I tried adding it to my project's .babelrc plugins list

{
  "presets": ["react-native"],
  "plugins": ["transform-replace-object-assign"],
  "env": {
    "production": {
      "plugins": ["transform-remove-console"]
    }
  }
}

Now the error is:

error: bundling: Error: Couldn't find preset "airbnb" relative to directory "/Users/nthompson/Documents/react-native/REDACTED/node_modules/rheostat"
    at /Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/index.js:135:24)
    at Pipeline.transform (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
TransformError: /Users/nthompson/Documents/react-native/REDACTED/node_modules/rheostat/lib/Slider.js: Couldn't find preset "airbnb" relative to directory "/Users/nthompson/Documents/react-native/REDACTED/node_modules/rheostat"
Bundling `index.ios.js`  86.3% (1174/1264), failed.
error: bundling: Error: Couldn't find preset "airbnb" relative to directory "/Users/nthompson/Documents/react-native/REDACTED/node_modules/rheostat"
    at /Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/file/index.js:135:24)
    at Pipeline.transform (/Users/nthompson/Documents/react-native/REDACTED/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
TransformError: /Users/nthompson/Documents/react-native/REDACTED/node_modules/rheostat/lib/Slider.js: Couldn't find preset "airbnb" relative to directory "/Users/nthompson/Documents/react-native/REDACTED/node_modules/rheostat"

from rheostat.

njt1982 avatar njt1982 commented on June 9, 2024

Ok, there is clearly something wrong with either this package or my setup ;)

I have got my app working but only by running yarn install --no-lockfile inside the rheostat folder in the node_modules folder?!

from rheostat.

njt1982 avatar njt1982 commented on June 9, 2024

Lovely... Now getting this:

image

Think I'll move on to an alternative package...

from rheostat.

ljharb avatar ljharb commented on June 9, 2024

Are you perhaps using babel to transpile node_modules, and getting issues because you're including our babelrc?

from rheostat.

ljharb avatar ljharb commented on June 9, 2024

All of the dependencies you're getting complaints about are dev deps, so they shouldn't be coming up at all.

from rheostat.

ljharb avatar ljharb commented on June 9, 2024

(It looks like you're using react-native, which has the horrible advice of transpiling node_modules; if you're going to do that, you have to manually remove all .babelrc files on postinstall)

from rheostat.

njt1982 avatar njt1982 commented on June 9, 2024

I am indeed using React Native. 😊

Thanks for the response. Much appreciated.

Why are the Airbnb package seemingly the only ones that suffer this bad advice?

from rheostat.

ljharb avatar ljharb commented on June 9, 2024

Many packages publish .babelrc files. It's likely that you've just been lucky, and only consumed packages that npmignore babelrc files.

This is a bug in the react-native packager, and it's not on individual packages to fix it. You can add a postinstall script to your app that removes them, however.

from rheostat.

hameed0z avatar hameed0z commented on June 9, 2024

are you using the rheostat with RN app?
if so could you give me some hints how ?

from rheostat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.