ccxt: Add a hasCORS boolean property to the Exchange Structure /// Webpack throws error when building in Nuxt
I think it would be great to have a hasCORS boolean property in the Exchange Structure. So we would only need to define a proxy on the client side if it is really needed.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 37 (23 by maintainers)
Commits related to this issue
- added hasCORS #225 — committed to ccxt/ccxt by kroitor 7 years ago
@kireerik @cklester So here’s the solution. Add the following to your
config/nuxt.jsfile: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.
Hope this helps.
I’ve granted access for @xpl to the example repo.
@kireerik I suspect that it is caused by a Webpack config where the
node_modulesfolder 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…)@xpl Done! Thank you!
@kireerik Can you please upload somewhere a minimal demo project (with Nuxt and everything set up) that demonstrates the error you experience?
Thank you @xpl for your comment!
I think I have ES6/ES7 Transpilation included with Nuxt.js. I am also using async functions and await operators in my project it self. So I guess this issue can be related to this library.
@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.
Here’s how you can do it with Webpack:
babel-loader.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!
Sure, I have tried the same with Yarn (I am using it for performance reasons basically), but it doesn’t make any difference.
I did some manual binary like search trying different versions and I can say that this issue was introduced with version
1.7.78and it is working up to version1.7.77.