privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
https://tsx.is
MIT License
8.61k stars 132 forks source link

Cannot find module #581

Closed hirotomoyamada closed 3 weeks ago

hirotomoyamada commented 3 weeks ago

Acknowledgements

Minimal reproduction URL

https://github.com/yamada-ui/yamada-ui/actions/runs/9415349864/job/25936180360

Problem & expected behavior (under 200 words)

If you install tsx 4.13.0 or higher, an error will occur. In 4.12.1 the error did not occur.

Run pnpm observe:pr

> yamada-ui@1.0.0 observe:pr /home/runner/work/yamada-ui/yamada-ui
> tsx scripts/observe-pull-requests

node:internal/modules/cjs/loader:1145
  const err = new Error(message);
              ^

Error: Cannot find module './components'
Require stack:
- /home/runner/work/yamada-ui/yamada-ui/packages/core/src/index.ts
- /home/runner/work/yamada-ui/yamada-ui/packages/providers/src/ui-provider.tsx
- /home/runner/work/yamada-ui/yamada-ui/packages/providers/src/index.ts
- /home/runner/work/yamada-ui/yamada-ui/packages/react/src/index.ts
- /home/runner/work/yamada-ui/yamada-ui/scripts/observe-pull-requests.ts
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at resolve (/home/runner/work/yamada-ui/yamada-ui/node_modules/.pnpm/tsx@4.13.2/node_modules/tsx/dist/register-Dmqgp8In.cjs:1:2193)
    at /home/runner/work/yamada-ui/yamada-ui/node_modules/.pnpm/tsx@4.13.2/node_modules/tsx/dist/register-Dmqgp8In.cjs:1:2777
    at m._resolveFilename (file:///home/runner/work/yamada-ui/yamada-ui/node_modules/.pnpm/tsx@4.13.2/node_modules/tsx/dist/register-3lr6qUE1.mjs:1:831)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at <anonymous> (/home/runner/work/yamada-ui/yamada-ui/packages/core/src/index.ts:3:15)
    at Object.<anonymous> (/home/runner/work/yamada-ui/yamada-ui/packages/core/src/index.ts:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1358:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/yamada-ui/yamada-ui/packages/core/src/index.ts',
    '/home/runner/work/yamada-ui/yamada-ui/packages/providers/src/ui-provider.tsx',
    '/home/runner/work/yamada-ui/yamada-ui/packages/providers/src/index.ts',
    '/home/runner/work/yamada-ui/yamada-ui/packages/react/src/index.ts',
    '/home/runner/work/yamada-ui/yamada-ui/scripts/observe-pull-requests.ts'
  ]
}

Node.js v20.14.0
 ELIFECYCLE  Command failed with exit code 1.
Error: Process completed with exit code 1.

Bugs are expected to be fixed by those affected by it

Compensating engineering work financially will speed up resolution

stackia commented 3 weeks ago

Same here.

Reproduction url: https://stackblitz.com/edit/node-qqnaj1