3s3s / opentrade

OpenTrade - Open Source Cryptocurrency Exchange
MIT License
396 stars 401 forks source link

ejs crash on latest code #333

Closed ShorelineCrypto closed 4 years ago

ShorelineCrypto commented 4 years ago

I have tried to upgrade exchange software ShorelineCrypto to latest code base here with no success so far. It appears now that that main cause is the "ejs" module that crashed on opentrade, from old or new code base. The error was very non-informative like "Something broke!" on web browser. This same error persist no mater what I used, new code base latest on opentrade, or older version without coupon feature. Even restore git commit to a working version in Nov still get same error same crash. Nodejs 6.0.0 to 8.10 to 12.6, Ubuntu 16.4 or Ubuntu 18.4 all tried, Same crash same error.

Now I recalled that that right before the big crash 2 days ago, I had many commit versions of a working exchange. This crash came after I did "npm install ejs" for testing around. The fresh droplet of Ubuntu 18.4 on kzv's latest code base master branch,followed exactly steps on OpenTrade README first page, just modify some IP, recaptcha parameter, and coin password, the latest opentrade master branch runs with below error on web. This point to "ejs" module is really the culprit that causes trouble:

SyntaxError: Unexpected token . in /root/opentrade/server/views/pages/index.ejs while compiling ejs

If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
Or, if you meant to create an async function, pass `async: true` as an option.
    at new Function (<anonymous>)
    at Template.compile (/root/opentrade/node_modules/ejs/lib/ejs.js:626:12)
    at Object.compile (/root/opentrade/node_modules/ejs/lib/ejs.js:366:16)
    at handleCache (/root/opentrade/node_modules/ejs/lib/ejs.js:215:18)
    at tryHandleCache (/root/opentrade/node_modules/ejs/lib/ejs.js:254:16)
    at View.exports.renderFile [as engine] (/root/opentrade/node_modules/ejs/lib/ejs.js:459:10)
    at View.render (/root/opentrade/node_modules/express/lib/view.js:135:8)
    at tryRender (/root/opentrade/node_modules/express/lib/application.js:640:10)
    at Function.render (/root/opentrade/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/root/opentrade/node_modules/express/lib/response.js:1012:7)
ShorelineCrypto commented 4 years ago

After below command in opentrade folder, the opentrade web page comes up:

npm unstall ejs
npm install ejs-lint
3s3s commented 4 years ago

It seems the latest version ejs bug. Please check new commit OpenTrade. Should be fixed now