angularjs - only one instance of babel/polyfill is allowed with angular ui-router -
currently, work school project , want show charts angularjs , meteor.
i want use ui-router plugin. when try use it, following error:
error: 1 instance of babel/polyfill allowed @ object.eval (eval @ <anonymous> (http://localhost:3000/packages/jquery.js?hash=22a0055f59bd150c435c5aba34c7c59076b8bcd9:397:22), <anonymous>:2872:9) @ object.1.180 (eval @ <anonymous> (http://localhost:3000/packages/jquery.js?hash=22a0055f59bd150c435c5aba34c7c59076b8bcd9:397:22), <anonymous>:2875:4) @ s (eval @ <anonymous> (http://localhost:3000/packages/jquery.js?hash=22a0055f59bd150c435c5aba34c7c59076b8bcd9:397:22), <anonymous>:2863:254) @ e (eval @ <anonymous> (http://localhost:3000/packages/jquery.js?hash=22a0055f59bd150c435c5aba34c7c59076b8bcd9:397:22), <anonymous>:2863:425) @ eval (eval @ <anonymous> (http://localhost:3000/packages/jquery.js?hash=22a0055f59bd150c435c5aba34c7c59076b8bcd9:397:22), <anonymous>:2863:443) @ eval (eval @ <anonymous> (http://localhost:3000/packages/jquery.js?hash=22a0055f59bd150c435c5aba34c7c59076b8bcd9:397:22), <anonymous>:7043:4) @ eval (eval @ <anonymous> (http://localhost:3000/packages/jquery.js?hash=22a0055f59bd150c435c5aba34c7c59076b8bcd9:397:22), <anonymous>:7050:3) @ eval (<anonymous>) @ http://localhost:3000/packages/jquery.js?hash=22a0055f59bd150c435c5aba34c7c59076b8bcd9:397:22 @ function.globaleval (http://localhost:3000/packages/jquery.js?hash=22a0055f59bd150c435c5aba34c7c59076b8bcd9:398:7) <div ui-view="" class="ng-scope" data-ng-animate="1">
also warning:
synchronous xmlhttprequest on main thread deprecated because of detrimental effects end user's experience. more help, check https://xhr.spec.whatwg.org/.
i have no idea message want tell me. didnt load babel/polyfill more 1 time. before got message didnt know of plugin.
this main.js ui-router code:
import angular 'angular'; import angularmeteor 'angular-meteor'; import uirouter 'angular-ui-router'; import ngmaterial 'angular-material'; import '../../../node_modules/angular-material/angular-material.css' import '../own.css'; import template './main.html'; import { name navigation } '../navigation/navigation'; import {name toolbar} '../toolbar/toolbar'; import {name view1} '../view1/view1'; import {name view2} '../view2/view2'; class main {} const name = 'main'; // create module export default angular.module(name, [ angularmeteor, uirouter, navigation, toolbar, view2, view1, ngmaterial ]).component(name, { template, controlleras: name, controller: main }) .config(config); function config($mdthemingprovider,$urlrouterprovider,$stateprovider ) { 'nginject'; $urlrouterprovider.otherwise('view1'); $stateprovider .state('view1', { url: '/', templateurl: 'test.html' }); $mdthemingprovider .theme('default') .primarypalette('orange') .accentpalette('deep-orange') .warnpalette('red'); }
and code of main.html view should injected:
<div layout="column" style="height: 100%"> <toolbar scroll></toolbar> <section layout="row" flex> <navigation></navigation> <md-content flex layout-padding style="margin-top: 75px"> <div ui-view=""></div> </md-content> </section>
without ui-router works fine!
what problem here?
most have module requiring babel-polyfill compile , it's polluting global namespace multiple versions of babel. therefore want either tell babel ignore node_modules directory , or figure out dependency requiring babel-polyfill , prevent that.
the final option compile code runtime transformer.
Comments
Post a Comment