Typescript - Error: Debug Failure. False Expression:

Asked

Viewed 141 times

4

I am trying to create a module definition Node.js. I have the file poolredis.ts, but when I add the line:

import { RedisClient } from 'redis';

The Typescript compiler gives me the error:

Error: Debug Failure. False Expression:

How can I fix it?

  • I translated your question, because this is Stackoverflow in English. If you have an error or you want to add more information just edit the question.

2 answers

1

You can import 3 ways being 1 of them this way, case of errors try to procreate the types then install them with the following command

npm i @types/redis --save

if the error continues, you can import it in another way and in 2 different ways, the following being:

const redisClient = require('redis');

OR

import * as RedisClient from 'redis';

if the error persists you need to see the library documentation.

0

npm install -s @types/redis

I think that’s it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.