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

Couldn't find preset "env" relative to drectory #32

Closed
TrueGeek opened this issue Jun 19, 2018 · 7 comments
Closed

Couldn't find preset "env" relative to drectory #32

TrueGeek opened this issue Jun 19, 2018 · 7 comments
Labels

Comments

@TrueGeek
Copy link

When I follow the setup instructions and then launch the simulator I get the message

Failed to load bundle .... with error: (/Users/me/code/project/node_modules/highcharts-react-official/index.js: Couldn't find preset "env" relative to directory "/Users/me/code/project/node_modules/highcharts-react-office" (null))

Has anyone else seen this? Am I missing a step where I was supposed to setup an "env" variable?

@pawelfus
Copy link

pawelfus commented Jun 20, 2018

Hi @TrueGeek

Unfortunately, I haven't seen this error. I can not find package highcharts-react-office in the NPM and the only reference in this repo to office is ... this issue. Is this exactly the error from console?

Every similar bug report on github refers to.. babel-preset-env and that babel-preset-env should be installed. We have this in devDependencies, but it seems wrong to require this, even for a workaround if you don't need it. Could you provide more details? Steps to reproduce and minimal example would be great, thanks!

@TrueGeek
Copy link
Author

Sorry, no, that's a typo at the end. highcharts-react-office should be highcarts-react-official.

Here are the complete steps to recreate:

In a terminal:

react-native init HighchartsTest

cd HighchartsTest

npm install highcharts-react-official highcharts react react-dom

npm install

react-native run-ios

The app loads fine at this point.

In App.js add these three lines at the top:

import { render } from 'react-dom'
import Highcharts from 'highcharts'
import HighchartsReact from 'highcharts-react-official'

The result is this:

simulator screen shot - iphone 6 - 2018-06-20 at 11 22 13

@pawelfus
Copy link

Thank you for the details. You are right, it's buggy. We will check what happens there.

@pawelfus pawelfus added the bug label Jun 22, 2018
@sebastianbochan
Copy link

Hi @TrueGeek,
The reason of problem is missing three packages of babel.

  • babel-core
  • babel-preset-react
  • babel-preset-env

After installation, I do not have any errors in emulator iOS and Expo.

Related topic: babel/babel-preset-env#186

@Anujmoglix
Copy link

in react native getting issue with div ,

@Nagu07
Copy link

Nagu07 commented Jul 24, 2020

Can some one help how you resolved this issue

@ppotaczek
Copy link
Contributor

Hi @Nagu07,

Please provide me with more information about the issue and your project configuration settings because this problem should no longer be present.

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