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

大憨熊 提交于 2021-02-10 17:29:48

问题


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:


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



来源:https://stackoverflow.com/questions/53427901/error-cannot-load-preset-env-relative-to-in-a-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!