0

I found this library and am trying to make it into a back-end with NestJS. This is the first time I am doing something like this and I am running into quite a few issues... Right now the real issue I am having is that I cannot use an API call, since there is an error in the tsconfig that blocks progress. I have seen this error on the typescript github posted quite a few times... Since 2017 and still no solution is provided... The issue I am talking about is Option 'allowJs' cannot be specified with option 'declaration'. which seems to be a returning issue in typescript. How do I handle this? I am trying to send in 2 strings to the api and return a constructed image. Github

enter image description here

1 Answers1

0

This was fixed in 3.7, I see in your package.json that you're on 3.6, you could upgrade to typescript@beta or typescript@rc as those are 3.7 at the moment and that will fix it.

  • Are you sure this was fixed? i have tried updating my typescript to both versions and the error remains the same. – Torben Van Assche Oct 31 '19 at 12:49
  • I tried it myself, after upgrading the TypeScript version the tsconfig error didn't show up anymore. Where are you seeing this error? –  Oct 31 '19 at 12:51
  • I am getting it when running the ```nest start``` command. It gets dropped into the console. – Torben Van Assche Oct 31 '19 at 12:52
  • Those are other errors, not from the `tsconfig`. They're from the `index.js` file. –  Oct 31 '19 at 12:57
  • I've added a screenshot of the exact error I am seeing to my initial post. – Torben Van Assche Oct 31 '19 at 13:00
  • Ah, in VS Code. Did you tell VS Code to use the TypeScript version in your workspace folder, instead of its own? –  Oct 31 '19 at 13:04
  • I am not 100% sure I know how to do that. I'm trying to find out which one it is using. because that seeems possible. I have tried this just now. I don't know what else I would need to do. https://stackoverflow.com/questions/54810894/how-to-force-vscode-to-use-locally-installed-typescript – Torben Van Assche Oct 31 '19 at 13:09
  • When you have a TypeScript file open, in the bottom right corner the version will be displayed and you can click on it to change it. –  Oct 31 '19 at 13:12
  • Ok, I just checked. I have now changed the vscode version on the bottom to reflect the beta. I am still getting the same error though. maybe its not the vscode that needs to know the version but nestjs itself? – Torben Van Assche Oct 31 '19 at 13:16
  • Try reloading VS Code. –  Oct 31 '19 at 13:17
  • index.js line 3: Declaration emit for this file requires using private name '(Anonymous function)'. An explicit type annotation may unblock declaration emit. *confused screaming* – Torben Van Assche Oct 31 '19 at 13:22