Closed JCLMAQ closed 4 years ago
Error stay with preview022. Adding within package.json (devDependencies):
"@prisma/sdk": "^0.0.208",
"@prisma/engine-core": "^2.0.110",
"@prisma/generator-helper": "^0.0.40",
"chalk": "^3.0.0",
avoid errors linked to @prisma unless the one related to "chalk".
Hey @JCLMAQ, thanks for reporting this! Do you have a simple repo where I can see this as well?
I haven't used NestJS before, but I think autogenerated files should be excluded from compilation. Either way, an example repo would help me dig deeper!
There is an invitation for the repo I use: https://github.com/JCLMAQ/nestjs-prisma2-jcm/invitations I still have the error for 'Chalk', but for now NestJS don't stop anymore...
10:24:26 - File change detected. Starting incremental compilation...
prisma/Studio/-Wakanda-Desktop-NestJS-nestjs-prisma2-jcm-backend/runtime/highlight/theme.d.ts:1:8 - error TS1259: Module '"D:/Wakanda-Desktop/NestJS/nestjs-prisma2-jcm/backend/node_modules/chalk/index"' can only be default-imported using the 'esModuleInterop' flag
1 import chalk from 'chalk';
~~~~~
node_modules/chalk/index.d.ts:411:1
411 export = chalk;
~~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
10:24:29 - Found 1 error. Watching for file changes.
[Nest] 15000 - 28/02/2020 à 10:24:29 [NestFactory] Starting Nest application...
[Nest] 15000 - 28/02/2020 à 10:24:29 [InstanceLoader] AppModule dependencies initialized +52ms
[Nest] 15000 - 28/02/2020 à 10:24:29 [Insta...
Hey, I'm going to transfer this to the prisma2 repo, since this does not seem specific to Studio, but rather something with the prisma2 CLI's build. @pantharshit00 can then take a look. Could you share your repo with him as well? (Or perhaps make it public?) He also pointed me to a NestJS template a community member made that you might find useful to compare to: https://github.com/fivethree-team/nestjs-prisma-starter
Might I also suggest turning on esModuleInterop
in your tsconfig as the error states and see if that helps?
Thanks for the reply. To start with prisma2 and Nestjs in fact I did use the NestJS template you point out . @pantharshit00 an invitation for the repo (still private for know) https://github.com/JCLMAQ/nestjs-prisma2-jcm/invitations
Adding "esModuleInterop = true" in nestjs config.ts solve the issue. Thanks. I should read error state more often ...
@JCLMAQ Sorry for the late reply here, but can this be closed now as this is resolved? Can you please confirm?
Yes. Thank you.
prisma2 -v
): preview02111:55:38 - Starting compilation in watch mode...
prisma/Studio/-Wakanda-Desktop-NestJS-nestjs-prisma2-jcm-backend/runtime/browser.d.ts:5:41 - error TS2307: Cannot find module '@prisma/engine-core/dist/BrowserEngine'.
5 export { BrowserEngine as Engine } from '@prisma/engine-core/dist/BrowserEngine';
prisma/Studio/-Wakanda-Desktop-NestJS-nestjs-prisma2-jcm-backend/runtime/getDMMF.d.ts:1:22 - error TS2307: Cannot find module '@prisma/generator-helper'.
1 import { DMMF } from '@prisma/generator-helper';
prisma/Studio/-Wakanda-Desktop-NestJS-nestjs-prisma2-jcm-backend/runtime/highlight/theme.d.ts:3:30 - error TS2503: Cannot find namespace 'chalk'. 3 export declare const orange: chalk.Chalk;
prisma/Studio/-Wakanda-Desktop-NestJS-nestjs-prisma2-jcm-backend/runtime/highlight/theme.d.ts:5:28 - error TS2503: Cannot find namespace 'chalk'. 5 export declare const blue: chalk.Chalk;