Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module not found: Can't resolve 'perf_hooks' ReactJS

I'm working on reactjs (17.0.1) (node v15.11.0) with typescript and I'm getting this warning message, any idea how solve it ?

./node_modules/typescript/lib/typescript.js
Critical dependency: the request of a dependency is an expression

./node_modules/typescript/lib/typescript.js
Critical dependency: the request of a dependency is an expression

./node_modules/typescript/lib/typescript.js
Module not found: Can't resolve 'perf_hooks' in '/Users/jorge/Documents/Development/Projects/React-Js/project/node_modules/typescript/lib'

thanks in advance

like image 732
Jorge Quiñones Avatar asked Nov 15 '22 20:11

Jorge Quiñones


1 Answers

As far as I can tell this is still an outstanding issue: https://github.com/microsoft/TypeScript/issues/39436

I get the exact same 3 warnings when I import anything from typescript - ex:

import { transpile } from 'typescript';

results in:

Compiled with warnings.

./node_modules/typescript/lib/typescript.js Critical dependency: the request of a dependency is an expression

./node_modules/typescript/lib/typescript.js Critical dependency: the request of a dependency is an expression

./node_modules/typescript/lib/typescript.js Module not found: Can't resolve 'perf_hooks' in 'C:\me\myName\GitHub\projectFolder\node_modules\typescript\lib'

like image 199
John Avatar answered Jan 04 '23 13:01

John