SinhNQ Posted February 27, 2018 Share Posted February 27, 2018 I received error when trying require babylon.js v3.2-alphaA. That normal in bjs previous (v3.2-alpha7). Log: Uncaught Error: Module name "babylonjs" has not been loaded yet for context: _. Use require([]) http://requirejs.org/docs/errors.html#notloaded at makeError (require.js:168) at Object.localRequire [as require] (require.js:1433) at requirejs (require.js:1794) Quote Link to comment Share on other sites More sharing options...
Guest Posted February 27, 2018 Share Posted February 27, 2018 pinging @RaananW Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 27, 2018 Share Posted February 27, 2018 Hi @SinhNQ, would be great to know how your package.json and index file look like so I can debug this further. What are you trying to include? is babylon in your node_modules? Quote Link to comment Share on other sites More sharing options...
SinhNQ Posted February 28, 2018 Author Share Posted February 28, 2018 Hi @RaananW, I has found cause error. I'm using require.js lib to require modules. In line 22-23 in babylon.max.js. else if(typeof define === 'function' && define.amd) define("babylonjs", factory); I guess the syntax define function used for nodejs. Unfortunately, in require.js also have define function but different syntax. I has changed to else if(typeof define === 'function' && define.amd) define([], factory); and it work great. Thank you! Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 28, 2018 Share Posted February 28, 2018 I wanted to define the module ID ("babylonjs"). The new AMD signature was just added a week ago, so it is still being perfected. It should be . define("babylonjs", [], factory); I will check when I do that and let you know. SinhNQ 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.