Nodejs es6 import backendless + typescript

yes, you are running “yarn start”


Valodyas-MBP:sample valodya$ yarn start
yarn run v1.3.2
(node:62908) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
$ nodemon --watch '**/*.ts' --ignore 'node_modules/**/*' --exec ts-node src/Server.ts
[nodemon] 1.18.10
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: **/*.ts
[nodemon] starting `ts-node src/Server.ts`

/Users/valodya/Downloads/sample/src/Server.ts:12
Backendless.initApp("APP_KEY", "SECRET_KEY");
            ^
TypeError: Cannot read property 'initApp' of undefined
    at Object.<anonymous> (/Users/valodya/Downloads/sample/src/Server.ts:12:13)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module.m._compile (/Users/valodya/Downloads/sample/node_modules/ts-node/src/index.ts:413:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Users/valodya/Downloads/sample/node_modules/ts-node/src/index.ts:416:12)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at Object.<anonymous> (/Users/valodya/Downloads/sample/node_modules/ts-node/src/bin.ts:151:12)
[nodemon] app crashed - waiting for file changes before starting...


“start”: “nodemon --watch ‘/*.ts’ --ignore 'node_modules//*’ --exec ts-node src/Server.ts”,

most likely the problem is here –ignore 'node_modules//*'** because of backendless.d.ts file is located in ./node_modules/backendless/backendless.d.ts