Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ERR_PACKAGE_PATH_NOT_EXPORTED eslint-plugin-import error when importing @mdx-editor/editor #466

Closed
2 tasks done
hsunami10 opened this issue May 21, 2024 · 3 comments
Labels
bug Something isn't working released

Comments

@hsunami10
Copy link

If you want to ask for support or request features, sponsor the project and contact me over email.

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug

When running ESLint, I get this error from eslint-plugin-import in the file that I import @mdx-editor/editor:

ESLint: 8.57.0

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib' is not defined by "exports" in /Users/name/frontend/node_modules/mdast-util-from-markdown/package.json
Occurred while linting /Users/name/frontend/src/ui/markdown/MarkdownEditor.tsx:1
Rule: "import/namespace"
    at exportsNotFound (node:internal/modules/esm/resolve:303:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:650:9)
    at resolveExports (node:internal/modules/cjs/loader:591:36)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at findModulePath (/Users/michaelhsu/vanna-portal/frontend/node_modules/eslint-import-resolver-alias/index.js:99:27)
    at exports.resolve (/Users/michaelhsu/vanna-portal/frontend/node_modules/eslint-import-resolver-alias/index.js:75:10)
    at withResolver (/Users/michaelhsu/vanna-portal/frontend/node_modules/eslint-module-utils/resolve.js:121:23)
    at fullResolve (/Users/michaelhsu/vanna-portal/frontend/node_modules/eslint-module-utils/resolve.js:142:22)
    at Function.relative (/Users/michaelhsu/vanna-portal/frontend/node_modules/eslint-module-utils/resolve.js:158:10)
    at remotePath (/Users/michaelhsu/vanna-portal/frontend/node_modules/eslint-plugin-import/lib/ExportMap.js:811:381)

I've ignored this error by adding the code snippet below in my .eslintrc.yml:

settings:
  import/ignore:
    - \.*@mdxeditor/editor.*$

I'd like an actual way to fix this though, if anyone has any ideas, please let me know!

package.json

{
  "name": "vanna-portal",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "lint": "eslint . --ext .ts,.tsx --report-unused-disable-directives --max-warnings 0",
    "lint:fix": "npm run --silent lint --fix",
    "prettier": "prettier --check \"src/**/*.{ts,tsx,css,md}\" --config ./.prettierrc.yml",
    "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,css,md}\" --config ./.prettierrc.yml",
    "format": "npm run --silent prettier:fix && npm run --silent lint:fix",
    "preview": "vite preview"
  },
  "dependencies": {
    "@emotion/react": "^11.11.4",
    "@mdxeditor/editor": "^3.3.5",
    "@types/mdast": "^4.0.4",
    "axios": "^1.7.2",
    "firebase": "^10.12.1",
    "markdown-to-jsx": "^7.4.7",
    "path": "^0.12.7",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-dropzone": "^14.2.3",
    "react-error-boundary": "^4.0.13",
    "react-router-dom": "^6.23.1",
    "react-toastify": "^10.0.5",
    "react-tooltip": "^5.26.4",
    "swr": "^2.2.5"
  },
  "devDependencies": {
    "@trivago/prettier-plugin-sort-imports": "^4.3.0",
    "@types/node": "^20.12.12",
    "@types/react": "^18.3.2",
    "@types/react-dom": "^18.3.0",
    "@typescript-eslint/eslint-plugin": "^7.10.0",
    "@typescript-eslint/parser": "^7.10.0",
    "@vitejs/plugin-react-swc": "^3.6.0",
    "eslint": "^8.57.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-import-resolver-alias": "^1.1.2",
    "eslint-import-resolver-typescript": "^3.6.1",
    "eslint-plugin-import": "^2.29.1",
    "eslint-plugin-react": "^7.34.1",
    "eslint-plugin-react-hooks": "^4.6.2",
    "eslint-plugin-react-refresh": "^0.4.7",
    "prettier": "3.2.5",
    "typescript": "^5.4.5",
    "vite": "^5.2.11"
  }
}
@hsunami10 hsunami10 added the bug Something isn't working label May 21, 2024
Copy link

🎉 This issue has been resolved in version 3.3.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@petyosi
Copy link
Contributor

petyosi commented May 22, 2024

Let me know if the above release fixes it for you.

@hsunami10
Copy link
Author

it's fixed, thanks a lot!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants