1

I'm having the following error while deploying my application in pm2. This error appears in the Prisma.ts file.

05-12-2018 15:53:34: export interface Query {
05-12-2018 15:53:34: ^^^^^^
05-12-2018 15:53:34: 
05-12-2018 15:53:34: SyntaxError: Unexpected token export
05-12-2018 15:53:34:     at new Script (vm.js:79:7)
05-12-2018 15:53:34:     at createScript (vm.js:251:10)
05-12-2018 15:53:34:     at Object.runInThisContext (vm.js:303:10)
05-12-2018 15:53:34:     at Module._compile (internal/modules/cjs/loader.js:657:28)
05-12-2018 15:53:34:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
05-12-2018 15:53:34:     at Module.load (internal/modules/cjs/loader.js:599:32)
05-12-2018 15:53:34:     at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
05-12-2018 15:53:34:     at Function.Module._load (internal/modules/cjs/loader.js:530:3)
05-12-2018 15:53:34:     at Module.require (internal/modules/cjs/loader.js:637:17)
05-12-2018 15:53:34:     at require (internal/modules/cjs/helpers.js:20:18)
05-12-2018 15:53:34: /home/user/Publish/PracticeBusiness/src/generated/prisma.ts:6

Please help me with this.

Thanks in advance.

Niks
  • 110
  • 1
  • 1
  • 10

1 Answers1

0

The issue was the I was not using the complied file(.js) instead i was using the (.ts) file and trying to host in node package.

The trick here was to use a typescript compiler and convert the .ts file to .js and everything worked for me.

Note: use tsc in VS code to do the conversion.

Niks
  • 110
  • 1
  • 1
  • 10