Error: Cannot load preset env relative to / in a browser

1.1k views Asked by At

I am creating interactive JavaScript coding exercise using ACE editor. to execute entered code have have to transform code. for that i am using @balel/core transform method. I am facing below problems

  1. when I use presets: ["env"] in options i am getting Error: Cannot load preset env relative to / in a browser. I already did npm install babel-preset-env to install preset
  2. transform is not overriding option babelrc: true
1

There are 1 answers

0
bruce.shaw On

cannot run babe-core in browser begin with version 6.0. only node so you can refer to babel-standalone. https://github.com/babel/babel-standalone