3

I have the following error:

Module build failed (from ./node_modules/ts-loader/index.js): Error: Debug Failure. False expression: Non-string value passed to ts.resolveTypeReferenceDirective, likely by a wrapping package working with an outdated resolveTypeReferenceDirectives signature. This is probably not a problem in TS itself. ...
@ multi babel-polyfill react-hot-loader/patch ./src/index.tsx

At this point I've been trying everything:

  • updating ts-node
  • updating typescript
  • updating ts-loader
  • updating configuration of babel and webpack

And still, nothing seems to solve this issue.

At this point, I think it's not strictly related to the TS, but more likely with react-hot-loader configuration/usage, but I'm not sure. Here are my packages versions:

"react-hot-loader": "^4.5.3",
"ts-jest": "^27.1.4",
"ts-node": "^10.8.1",
"ts-node-dev": "^2.0.0",
"typescript": "^4.7.4",

And webpack config for TS and react-hot-loader:

  module.exports = {
  entry: ['babel-polyfill', 'react-hot-loader/patch', './src/index.tsx'], 
  [...]
    module: {
rules: [
  {
    test: /\.(js|jsx|ts|tsx)$/,
    exclude: /node_modules/,
    use: {
      loader: 'babel-loader',
    },
  },
  {
    test: /\.(ts|tsx)?$/,
    use: 'ts-loader',
    exclude: /node_modules/,
  },

If someone could give me some hints on what to look for now, or what can be wrong, I would appreciate it. Thanks in advance!

Bart98
  • 39
  • 1
  • 2
  • Does this answer your question? [False expression: Non-string value passed to \`ts.resolveTypeReferenceDirective\` in typescript](https://stackoverflow.com/questions/72488958/false-expression-non-string-value-passed-to-ts-resolvetypereferencedirective) – Vega Jul 24 '22 at 20:04
  • Having the same issue with my vue project. Did you find any solution ? – walox Nov 16 '22 at 09:13
  • Happened to me when I tried to update a `@types` package (`@types/three`). I have temporarily reverted back to an old archived DefinitelyTyped folder on my computer and that seems to resolve things for now until I can figure out what I need to update. – General Grievance May 09 '23 at 19:25

1 Answers1

0

I had the same problem as you, I also tried almost all the things you did and for me was the solution to upgrade the latest version of chakraUI to 2.2.1. If you are using a UI library like chakra, maybe upgrading the version of that will help.

part of my package.json:

@chakra-ui/cli: ^2.2.1
ts-node: ^10.8.2,
ts-node-dev: ^2.0.0,
typescript: ^4.6.4
bugra
  • 65
  • 1
  • 1
  • 7