This comment has been minimized.

edited

@kireerik we have recently dropped support for very old versions of Node (since ccxt 1.7.x+), because they are outdated and don't have async/await and other modern JS features. So, if you have Node 5 or 6, please, update to 7.6.0+.

This comment has been minimized.

edited by kroitor

@kireerik the problem you are experiencing is related to UglifyJS that does not understand ES2015 and modern async/await syntax out of the box. You may consider adding Babel to your build pipeline (before UglifyJS), to transpile everything down to plain old ECMAScript5.

You can also try switching to another minifier that supports ECMAScript6 and async/await, but if you're building a browser app and want to support older browsers, it would be better if you use Babel. Hope this helps!

This comment has been minimized.

edited

@kireerik unfortunately, we can't access it on gitlab due to lack of permissions. If you're in contact with @cklester, can you please ask him to let us in? He's been very helpful to us previously. We could take a look to try and help fixing this bug / issue there. Thx!

This comment has been minimized.

edited

UPD: yep, now I see the error. Not sure what's causing it yet, though. Seems that it doesn't like the class keyword, so need to check whether the transpilation is configured correctly... I will investigate further.

This comment has been minimized.

edited

@kireerik I suspect that it is caused by a Webpack config where the node_modules folder is excluded from Babel, like in this issue. So will need to find where you can override this setting in AdonisJS (or Nuxt? Not sure...)

This will add CCXT to the Babel transpilation stage. Seems that it could be a common problem across various frameworks. So if you're not the only ones who are having this problem, we will reconsider adding the Babel transpilation stage to the CCXT itself.

This comment has been minimized.

edited

@kireerik What is your Webpack version? BTW, after adding the previously mentioned snippet to your Nuxt config, you should see this message in the log output:

[BABEL] Note: The code generator has deoptimised the styling of "/Users/mac/adonuxt-ccxt-example/node_modules/ccxt/ccxt.js" as it exceeds the max of "500KB".

It indicates that the transpilation is set up correctly and the CCXT source is going through Babel. If you don't see the message, something's wrong.

By the way did you made any braking changes in version 1.7.78?

We stopped using Babel, since the latest Node already supports all the syntax features we need, and there's no need in transpiling, and the browser people already use Babel on their ends... But it seems that even with that, some tools are just not yet ready for ES6 modules, as they expect everything in the node_modules to be pre-compiled to ES5.

If the problem persists, we will return Babel to our build pipeline, it's not a big problem.

This comment has been minimized.

I see. Yes, this occurred on Windows. Now I have tried using resolve(__dirname, '..', 'node_modules/ccxt')as recommended and it somewhat works (/node_modules[\\\/]ccxt[\\\/](.+)\.js$/ works too).

However when I visit the application in the browser I am getting the following error in both development and production mode:ccxt.js:2952 Uncaught (in promise) ReferenceError: regeneratorRuntime is not defined at Exchange.fetchTicker

It will add the required babel-polyfill dependency to your common scripts in the Webpack config. Let me know if it helped.

xpl
changed the title from
Add a hasCORS boolean property to the Exchange Structure
to
Add a hasCORS boolean property to the Exchange Structure / Issues with Uglify when using with NuxtSep 25, 2017

xpl
changed the title from
Add a hasCORS boolean property to the Exchange Structure / Issues with Uglify when using with Nuxt
to
Add a hasCORS boolean property to the Exchange Structure /// Webpack throws error when building in NuxtSep 25, 2017