react-simple-dropdown icon indicating copy to clipboard operation
react-simple-dropdown copied to clipboard

Receiving a build error when upgrading to 1.1.3

Open andrewdelprete opened this issue 9 years ago • 3 comments

Hey there, when upgrading to 1.1.3 I'm receiving the error below

Couldn't find preset "es2016" relative to directory "/Users/me/Work/project/node_modules/react-simple-dropdown" while parsing file: /Users/me/Work/project/node_modules/react-simple-dropdown/lib/components/Dropdown.js

It doesn't appear that babel-preset-es2016 is being installed when I run an npm install from my project (it's not in my node_modules folder). If I install this preset manually then the build works just fine without errors.

npm version: 3.3.12 node version: v5.1.0

Any thoughts?

Thank you!

andrewdelprete avatar Jun 23 '16 16:06 andrewdelprete

Here are some questions that will help me troubleshoot:

  • How are you including react-simple-dropdown in your project?
  • Are you installing from npm?
  • Are you using this repo directly?
  • Are you using webpack/browserify?

I've run this through a couple of my projects and it seems to work without incident. I'm not sure why babel would be causing issues, since compilation is done before publishing to npm.

takempf avatar Jun 23 '16 17:06 takempf

@andrewdelprete In this last update I added a .babelrc to the project. Are you using babel in your project? There's a possibility your build is somehow picking up react-simple-dropdown's .babelrc.

takempf avatar Jun 23 '16 17:06 takempf

Hey @Fauntleroy,

I'm installing from NPM and utilizing Browserify / Babel for my build. I have my own .babelrc at the root level of my project where I include the preset es2015. For some reason when I run an npm install from the root level of my project babel-preset-es2016 is not being installed even though you have it as a dependency in react-simple-dropdown. I don't think it's a .babelrc thing as much as an npm thing missing the required deps you defined in package.json. I hope that helps! Thanks for the quick reply and nice component!

andrewdelprete avatar Jun 24 '16 02:06 andrewdelprete