nanxiaobei / antd-img-crop

🗡 An image cropper for Ant Design Upload
MIT License
493 stars 156 forks source link

Module not found: Error: Can't resolve 'antd/lib/version/style' in '/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/antd-img-crop/dist' #241

Closed punkratz312 closed 1 year ago

punkratz312 commented 1 year ago

Module not found: Error: Can't resolve 'antd/lib/version/style' in '/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/antd-img-crop/dist'

after bumping to 4.12.2 this error occures: seems like something internal maybe?

image

up to date, audited 2569 packages in 3s

287 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (2 moderate, 11 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> therapy-manager@0.1.0 build
> craco build

Creating an optimized production build...
TypeError: Cannot set property mark of #<Object> which has only a getter
TypeError: Cannot set property mark of #<Object> which has only a getter
    at Object.connectTypeScriptPerformance (/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/typescript-reporter/profile/TypeScriptPerformance.js:12:36)
    at createTypeScriptReporter (/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/typescript-reporter/reporter/TypeScriptReporter.js:40:49)
    at Object.<anonymous> (/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/reporter/reporter-rpc/ReporterRpcService.js:21:30)
    at Generator.next (<anonymous>)
    at /Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/reporter/reporter-rpc/ReporterRpcService.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/reporter/reporter-rpc/ReporterRpcService.js:4:12)
    at /Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/reporter/reporter-rpc/ReporterRpcService.js:19:88
    at Object.<anonymous> (/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/RpcService.js:23:38)
    at Generator.next (<anonymous>)
TypeError: Cannot set property mark of #<Object> which has only a getter
TypeError: Cannot set property mark of #<Object> which has only a getter
    at Object.connectTypeScriptPerformance (/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/typescript-reporter/profile/TypeScriptPerformance.js:12:36)
    at createTypeScriptReporter (/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/typescript-reporter/reporter/TypeScriptReporter.js:40:49)
    at Object.<anonymous> (/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/reporter/reporter-rpc/ReporterRpcService.js:21:30)
    at Generator.next (<anonymous>)
    at /Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/reporter/reporter-rpc/ReporterRpcService.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/reporter/reporter-rpc/ReporterRpcService.js:4:12)
    at /Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/reporter/reporter-rpc/ReporterRpcService.js:19:88
    at Object.<anonymous> (/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/RpcService.js:23:38)
    at Generator.next (<anonymous>)
Failed to compile.

Module not found: Error: Can't resolve 'antd/lib/version/style' in '/Users/vcp/IdeaProjects/therapydesigner/02_Software/TherapyManager/frontend/node_modules/antd-img-crop/dist'

➜  frontend git:(dependabot-docker-02_Software-TherapyManager-backend-node-19.8.1-alpine) ✗ 
{
  "name": "therapy-manager",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@ant-design/colors": "7.0.0",
    "@ant-design/icons": "5.0.1",
    "@apollo/client": "3.7.12",
    "@apollo/link-context": "2.0.0-beta.3",
    "@apollo/link-error": "2.0.0-beta.3",
    "@craco/craco": "7.1.0",
    "@react-hook/window-size": "3.1.1",
    "@react-keycloak/web": "3.4.0",
    "antd": "^5.4.2",
    "antd-img-crop": "4.12.2",
    "array-flatten": "3.0.0",
    "craco-antd": "2.0.0",
    "deep-equal": "2.2.0",
    "dompurify": "3.0.1",
    "graphql": "16.6.0",
    "http-proxy-middleware": "2.0.6",
    "i18next": "22.4.14",
    "i18next-browser-languagedetector": "7.0.1",
    "i18next-http-backend": "2.2.0",
    "jwt-decode": "3.1.2",
    "keycloak-js": "21.0.2",
    "lodash": "4.17.21",
    "moment": "2.29.4",
    "qrcode.react": "3.1.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-highlight-words": "0.20.0",
    "react-i18next": "12.2.0",
    "react-icons": "4.8.0",
    "react-idle-timer": "5.5.3",
    "react-image-file-resizer": "0.4.8",
    "react-qr-code": "2.0.11",
    "react-router": "6.10.0",
    "react-router-dom": "6.10.0",
    "react-router-hash-link": "2.4.3",
    "react-router-prompt": "0.5.2",
    "react-scripts": "5.0.1",
    "react-to-print": "2.14.12",
    "react-vega": "7.6.0",
    "string-to-color": "2.2.2",
    "styled-components": "5.3.9",
    "uuid": "9.0.0",
    "vega": "5.24.0",
    "vega-lite": "5.6.1",
    "web-vitals": "3.3.1"
  },
  "scripts": {
    "start": "craco start",
    "build": "craco build",
    "test": "craco test",
    "test:ci": "craco test --watchAll=false --coverage . --coverageDirectory=coverage --testResultsProcessor ./node_modules/jest-junit --reporters=jest-junit",
    "eject": "react-scripts eject",
    "codegen": "graphql:types & graphql:introspection",
    "graphql:types": "apollo client:codegen --target=typescript --globalTypesFile=src/services/graphql/types/globalTypes.ts ../types",
    "graphql:introspection": "graphql-codegen --config ./src/mocks/codegen-retrospection.yml",
    "lint": "eslint src",
    "lint:gitlab": "npm run lint -- --format gitlab .",
    "lint:fix": "npm run lint -- --fix",
    "prettier:format": "prettier --write ./src/**/*.{ts,tsx}",
    "prettier:check": "prettier --check  ./src/**/*.{ts,tsx}",
    "typecheck": "tsc"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@graphql-codegen/cli": "^3.3.0",
    "@graphql-codegen/introspection": "3.0.1",
    "@graphql-codegen/typescript": "3.0.3",
    "@graphql-codegen/typescript-operations": "3.0.3",
    "@graphql-codegen/typescript-react-apollo": "3.3.7",
    "@graphql-tools/mock": "^8.7.19",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^14.0.0",
    "@testing-library/user-event": "^14.4.3",
    "@types/deep-equal": "^1.0.1",
    "@types/dompurify": "^3.0.1",
    "@types/flat": "^5.0.2",
    "@types/jest": "^29.5.0",
    "@types/lodash": "^4.14.192",
    "@types/node": "18.15.11",
    "@types/qrcode.react": "^1.0.2",
    "@types/react": "18.0.35",
    "@types/react-dom": "18.0.11",
    "@types/react-highlight-words": "^0.16.4",
    "@types/react-icons": "^3.0.0",
    "@types/react-router": "^5.1.20",
    "@types/react-router-dom": "^5.3.3",
    "@types/react-router-hash-link": "^2.4.6",
    "@types/styled-components": "^5.1.26",
    "@types/uuid": "^9.0.1",
    "@typescript-eslint/eslint-plugin": "^5.58.0",
    "@typescript-eslint/parser": "^5.58.0",
    "@welldone-software/why-did-you-render": "^7.0.1",
    "apollo": "2.34.0",
    "eslint": "^8.38.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-config-prettier": "^8.8.0",
    "eslint-formatter-gitlab": "4.0.0",
    "eslint-plugin-import": "^2.27.5",
    "eslint-plugin-jsx-a11y": "^6.7.1",
    "eslint-plugin-react": "^7.32.2",
    "eslint-plugin-react-hooks": "^4.6.0",
    "jest-junit": "^15.0.0",
    "msw": "^1.2.1",
    "prettier": "^2.8.7",
    "typescript": "5.0.4"
  },
  "prettier": {
    "tabWidth": 2,
    "printWidth": 100,
    "semi": true
  },
  "jest": {
    "coverageReporters": [
      "text",
      "cobertura"
    ]
  }
}
punkratz312 commented 1 year ago

maybe some incompatibility with the other antd modules?

image
nanxiaobei commented 1 year ago

maybe something related to babel-plugin-import, please provide a reproducible demo