Issue in import of npm package ccxt in server (works in client)


#1

I’m having problem in using node package ccxt(crypto exchange). I managed to add the package and import/use in client side. However doing the same on server side is giving me error. I need to write the code in server side for the exchanges and use it in client. Any help would be appreciated,

This is my code in server/main.js
‘use strict’;
import ccxt from ‘ccxt’;

Error in build:
Your app is crashing. Here’s the latest log:
packages\modules.js:132
const Exchange = require (’./js/base/Exchange’)
^^^^^
SyntaxError: Use of const in strict mode.
at D:\Meteor\myapp.meteor\local\build\programs\server\boot.js:278:30
at Function..each..forEach (D:\Meteor\myapp\node_modules\underscore\underscore.js:153:9)
at D:\Meteor\myapp.meteor\local\build\programs\server\boot.js:133:5
Exited with code: 8
Your application is crashing. Waiting for file change.


#2

What version of Meteor are you running?

Have you tried removing the ‘use strict’; statement?
(Since the error message is complaining about strict mode?)


#3

Well, I tried removing use strict as well, still the same error.
I’m in latest Meteor version 1.7


#4

I too am in the latest Meteor, Version 1.7 and having the same issue.


#5

I reinstalled everything and tried and it all worked good for me. I’m still not sure what could have caused the issue, maybe some node version conflict. However issue resolved for me. Many thanks.


#6

Glad it fixed itself, because I had no idea what that could be