codemirror / codemirror5

In-browser code editor (version 5, legacy)
http://codemirror.net/5/
MIT License
26.69k stars 4.96k forks source link

Module not found: Error: Package path ./lib/codemirror.css is not exported from package #7019

Closed waliaAnurag closed 1 year ago

waliaAnurag commented 1 year ago

I am trying to use codemirror in my create-react-app project, but facing issues

below is the error i am facing:

Module not found: Error: Package path ./theme/material.css is not exported from package
Module not found: Error: Package path ./mode/xml/xml is not exported from package 
Module not found: Error: Package path ./mode/javascript/javascript is not exported from package 
Module not found: Error: Package path ./mode/css/css is not exported from package 
Module not found: Error: Can't resolve '/lib/codemirror.css' in 

I haven't found any solution to this problem, can anyone help on this.

Below is my package.json


{
  "name": "codepenclone",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "codemirror": "^6.0.1",
    "react": "^18.2.0",
    "react-codemirror2": "^7.2.1",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "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"
    ]
  }
}
marijnh commented 1 year ago

I don't know what the problem is, but I'd say it is something with your bundler or its configuration, and this is not the place to report it.