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

I get error when use just-in-time internal package with yarn workspaces #13934

Closed
ikaasraa opened this issue Sep 1, 2024 · 1 comment
Closed
Labels
needs triage This issue has not been looked into type: enhancement 🐺

Comments

@ikaasraa
Copy link

ikaasraa commented Sep 1, 2024

this my package and I want to use it in my nestjs app

{
  "name": "common",
  "version": "0.0.0",
  "exports": {
    ".": "./src/index.ts"
  },
  "private": true,
  "scripts": {
    "lint": "eslint --fix \"src/**/*.{ts,tsx}\""
  },
  "devDependencies": {
    "@nestjs/common": "^10.4.1",
    "@nestjs/config": "^3.2.3",
    "@nestjs/core": "^10.4.1",
    "@nestjs/graphql": "^12.2.0",
    "@nestjs/typeorm": "^10.0.2",
    "@types/node": "^22.5.1",
    "@typescript-eslint/eslint-plugin": "^8.3.0",
    "@typescript-eslint/parser": "^8.3.0",
    "eslint": "^8.57.0",
    "graphql": "^16.9.0",
    "reflect-metadata": "^0.2.2",
    "rxjs": "^7.8.1",
    "typeorm": "^0.3.20",
    "typescript": "^5.5.4"
  }
}

when I want to import in nestjs do not work well

I get this errr

[8:30:13 PM] Starting compilation in watch mode...

[8:30:15 PM] Found 0 errors. Watching for file changes.

node:internal/modules/cjs/loader:641
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './src/database' is not defined by "exports" in /Users/ikaaasra/Desktop/ALMAS/node_modules/@almas/common/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:304:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:651:9)
    at resolveExports (node:internal/modules/cjs/loader:634:36)
    at Module._findPath (node:internal/modules/cjs/loader:724:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1211:27)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/Users/ikaaasra/Desktop/ALMAS/packages/admin-server/src/app.module.ts:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1469:14) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v20.17.0

@ikaasraa ikaasraa added needs triage This issue has not been looked into type: enhancement 🐺 labels Sep 1, 2024
@micalevisk
Copy link
Member

⚠️ We use GitHub Issues to track bug reports, feature requests and regressions

Try the following instead:

@micalevisk micalevisk closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into type: enhancement 🐺
Projects
None yet
Development

No branches or pull requests

2 participants