как бы "type": "module", в package.json добавила и "module": "commonjs", в tsconfig.json попробовала добавить и babel-plugin-transform-es2015-modules-commonjs, @babel/plugin-transform-modules-commonjs плагины пробовала подключать. Ничего не помогает 🙁 что делать???
да, "query-string": "^8.1.0"
и хотелось бы сохранить версию
неужели jest никак не подружить с ней?
Вон первую ссылку попробуй Там эксмаскрипт содуль
Пробовала, не помогает ((
У тебя там commonjs тип в package?
явно это не прописано, вот содержимое: { "name": "frontend", "version": "0.1.0", "private": true, "dependencies": { "@reduxjs/toolkit": "^1.9.3", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "@types/jest": "^27.5.2", "@types/react": "^18.0.25", "@types/react-dom": "^18.0.9", "async-mutex": "^0.4.0", "clsx": "^1.2.1", "date-fns": "^2.29.3", "query-string": "^8.1.0", "react": "^18.2.0", "react-datepicker": "^4.8.0", "react-dom": "^18.2.0", "react-hook-form": "^7.41.0", "react-intersection-observer": "^9.4.4", "react-loading-skeleton": "^3.3.1", "react-redux": "^8.0.5", "react-router": "^6.4.4", "react-router-dom": "^6.4.4", "react-scripts": "5.0.1", "redux": "^4.2.0", "redux-persist": "^6.0.0", "sass": "^1.56.2", "typescript": "^4.9.3", "web-vitals": "^2.1.4" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!@query-string)/'", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "devDependencies": { "@types/react-datepicker": "^4.8.0", "@types/redux-persist": "^4.3.1", "react-scripts": "^5.0.1" } } и тайпсрипт конфига: { "extends": "../tsconfig.json", "include": ["src"], "exclude": ["node_modules"], "compilerOptions": { "baseUrl": "src", "target": "ES2020", "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx" }, "typeRoots": ["../node_modules/@types", "../@types"] }
Обсуждают сегодня