In my test file I import
import { getFormattedNumber } from 'react-phone-hooks';
and after running npx playwright test I receive
Error:
Cannot find module '/Users/.../web/node_modules/react-phone-hooks/locale' imported from /Users/.../web/node_modules/react-phone-hooks/index.js
I have rechecked library in node_modules. it has locale import and file is present tin directory
When i use this library in my components it works fine
Here is my config files:
tsconfig.json:
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2021",
"useDefineForClassFields": true,
"lib": ["ES2021", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": [
"**/*.ts",
"**/*.tsx"
]
}
Yakubets is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.