[GH-ISSUE #423] Hoarder v0.17.0 on Arch Linux run error #272

Closed
opened 2026-03-02 11:48:21 +03:00 by kerem · 4 comments
Owner

Originally created by @devome on GitHub (Sep 25, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/423

I'm the maintainer of hoarder on AUR. Now I have revert to v0.16.0, and the PKGBUILD of v0.17.0 see: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=hoarder&id=6beab33f442b0f0355557bac4edd67e1365e208a . The hoader-workers.service of the latest version v0.17.0 reports an error while running.

> @hoarder/workers@0.1.0 start:prod /usr/share/hoarder/apps/workers
> tsx index.ts

node:internal/modules/esm/resolve:304
  return new ERR_PACKAGE_PATH_NOT_EXPORTED(
         ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /usr/share/hoarder/apps/workers/node_modules/.pnpm/npm-run-path@6.0.0/node_modules/unicorn-magic/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:304:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:594:13)
    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 nextResolveSimple (/usr/share/hoarder/apps/workers/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:3:942)
    at /usr/share/hoarder/apps/workers/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:2:2550
    at /usr/share/hoarder/apps/workers/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:2:1624
    at resolveTsPaths (/usr/share/hoarder/apps/workers/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:3:760)
    at /usr/share/hoarder/apps/workers/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:3:1038 {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v20.17.0

And whether I build (and run) using nodejs v21 or v22, the same error is reported. The /usr/share/hoarder/apps/workers/node_modules/.pnpm/npm-run-path@6.0.0/node_modules/unicorn-magic/package.json is:

{
        "name": "unicorn-magic",
        "version": "0.3.0",
        "description": "Some useful utilities I often need",
        "license": "MIT",
        "repository": "sindresorhus/unicorn-magic",
        "funding": "https://github.com/sponsors/sindresorhus",
        "author": {
                "name": "Sindre Sorhus",
                "email": "sindresorhus@gmail.com",
                "url": "https://sindresorhus.com"
        },
        "type": "module",
        "exports": {
                "node": {
                        "types": "./node.d.ts",
                        "import": "./node.js"
                },
                "default": {
                        "types": "./default.d.ts",
                        "import": "./default.js"
                }
        },
        "sideEffects": false,
        "engines": {
                "node": ">=18"
        },
        "scripts": {
                "test": "xo && ava && tsc node.d.ts"
        },
        "files": [
                "node.js",
                "node.d.ts",
                "default.js",
                "default.d.ts"
        ],
        "keywords": [
                "utilities",
                "util",
                "extras",
                "url",
                "path",
                "delay",
                "wait",
                "settimeout",
                "sleep",
                "child_process",
                "child",
                "process",
                "subprocess",
                "exec",
                "execfile",
                "execfilesync"
        ],
        "devDependencies": {
                "ava": "^6.1.3",
                "in-range": "^3.0.0",
                "time-span": "^5.1.0",
                "typescript": "^5.5.4",
                "xo": "^0.59.2"
        }
}
Originally created by @devome on GitHub (Sep 25, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/423 I'm the maintainer of [hoarder on AUR](https://aur.archlinux.org/packages/hoarder). Now I have revert to v0.16.0, and the PKGBUILD of v0.17.0 see: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=hoarder&id=6beab33f442b0f0355557bac4edd67e1365e208a . The [hoader-workers.service](https://aur.archlinux.org/cgit/aur.git/tree/hoarder-workers.service?h=hoarder) of the latest version v0.17.0 reports an error while running. ```text > @hoarder/workers@0.1.0 start:prod /usr/share/hoarder/apps/workers > tsx index.ts node:internal/modules/esm/resolve:304 return new ERR_PACKAGE_PATH_NOT_EXPORTED( ^ Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /usr/share/hoarder/apps/workers/node_modules/.pnpm/npm-run-path@6.0.0/node_modules/unicorn-magic/package.json at exportsNotFound (node:internal/modules/esm/resolve:304:10) at packageExportsResolve (node:internal/modules/esm/resolve:594:13) 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 nextResolveSimple (/usr/share/hoarder/apps/workers/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:3:942) at /usr/share/hoarder/apps/workers/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:2:2550 at /usr/share/hoarder/apps/workers/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:2:1624 at resolveTsPaths (/usr/share/hoarder/apps/workers/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:3:760) at /usr/share/hoarder/apps/workers/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:3:1038 { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' } Node.js v20.17.0 ``` And whether I build (and run) using nodejs v21 or v22, the same error is reported. The `/usr/share/hoarder/apps/workers/node_modules/.pnpm/npm-run-path@6.0.0/node_modules/unicorn-magic/package.json` is: ```json { "name": "unicorn-magic", "version": "0.3.0", "description": "Some useful utilities I often need", "license": "MIT", "repository": "sindresorhus/unicorn-magic", "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "type": "module", "exports": { "node": { "types": "./node.d.ts", "import": "./node.js" }, "default": { "types": "./default.d.ts", "import": "./default.js" } }, "sideEffects": false, "engines": { "node": ">=18" }, "scripts": { "test": "xo && ava && tsc node.d.ts" }, "files": [ "node.js", "node.d.ts", "default.js", "default.d.ts" ], "keywords": [ "utilities", "util", "extras", "url", "path", "delay", "wait", "settimeout", "sleep", "child_process", "child", "process", "subprocess", "exec", "execfile", "execfilesync" ], "devDependencies": { "ava": "^6.1.3", "in-range": "^3.0.0", "time-span": "^5.1.0", "typescript": "^5.5.4", "xo": "^0.59.2" } } ```
kerem 2026-03-02 11:48:21 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@MohamedBassem commented on GitHub (Sep 26, 2024):

Interesting. First time seeing this error and it's not really clear to me where it's coming from. Hmmm, I'll need to debug this further over the weekend.

<!-- gh-comment-id:2378000733 --> @MohamedBassem commented on GitHub (Sep 26, 2024): Interesting. First time seeing this error and it's not really clear to me where it's coming from. Hmmm, I'll need to debug this further over the weekend.
Author
Owner

@Aethlas commented on GitHub (Oct 9, 2024):

Faced the same error:

"Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in [...] node_modules/unicorn-magic/package.json"

For quick workaround I changed below line to "execa": "9.1.0" so it pulls the older unicorn-magic package which worked for me. github.com/hoarder-app/hoarder@e2644ebc11/apps/workers/package.json (L17)

I think the error appears since https://github.com/sindresorhus/execa/pull/1156/commits/011f141a7367449335604e572415270ba6f7c0f8

npm-run-path references newer unicorn-magic github.com/sindresorhus/npm-run-path@ff3210b25f

which introduces those exports changes github.com/sindresorhus/unicorn-magic@fda76fb03d (diff-7ae45ad102)

Not sure why those exports changes introduces this error though.

<!-- gh-comment-id:2402551514 --> @Aethlas commented on GitHub (Oct 9, 2024): Faced the same error: > "Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in [...] node_modules/unicorn-magic/package.json" For quick workaround I changed below line to `"execa": "9.1.0" `so it pulls the older unicorn-magic package which worked for me. https://github.com/hoarder-app/hoarder/blob/e2644ebc11e9521ece054a846f8c993c322a8332/apps/workers/package.json#L17 I think the error appears since https://github.com/sindresorhus/execa/pull/1156/commits/011f141a7367449335604e572415270ba6f7c0f8 npm-run-path references newer unicorn-magic https://github.com/sindresorhus/npm-run-path/commit/ff3210b25ff8072111c55d82f46d194a2d7966a0 which introduces those exports changes https://github.com/sindresorhus/unicorn-magic/commit/fda76fb03d52371501cb505283b64ed2f4c7e774#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519 Not sure why those exports changes introduces this error though.
Author
Owner

@devome commented on GitHub (Oct 14, 2024):

@Aethlas Thanks, it works.

<!-- gh-comment-id:2409500095 --> @devome commented on GitHub (Oct 14, 2024): @Aethlas Thanks, it works.
Author
Owner

@MohamedBassem commented on GitHub (Oct 20, 2024):

I faced the same problem locally when upgrading to node22. I fixed that by pinning execa (github.com/hoarder-app/hoarder@a822ff26ce).

<!-- gh-comment-id:2424703100 --> @MohamedBassem commented on GitHub (Oct 20, 2024): I faced the same problem locally when upgrading to node22. I fixed that by pinning `execa` (https://github.com/hoarder-app/hoarder/commit/a822ff26ce83db867d4589181d21da20592fbf7c).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#272
No description provided.