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

tsx watch --ignore ... causes ERR_MODULE_NOT_FOUND errors #417

Open
3 of 5 tasks
karlhorky opened this issue Nov 27, 2023 · 0 comments
Open
3 of 5 tasks

tsx watch --ignore ... causes ERR_MODULE_NOT_FOUND errors #417

karlhorky opened this issue Nov 27, 2023 · 0 comments
Labels
bug Something isn't working pending triage

Comments

@karlhorky
Copy link

Precheck

  • I searched existing issues before opening this one to avoid duplicates
  • I'm able to reproduce this issue and prove it with a minimal reproduction
  • I understand this is not a place to ask for free debugging support

Problem

Ignoring files with --ignore ./../pkg-a/.next/**/* causes ERR_MODULE_NOT_FOUND error:

$ cd pkg-b

$ pnpm i
Lockfile is up to date, resolution step is skipped
Packages: +2
++
Done in 492ms

~/projects/node-d5jut7/pkg-b
$ pnpm tsx watch --clear-screen=false --ignore ./../pkg-a/.next/**/* index.ts

(node:77) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/projects/node-d5jut7/pkg-a/.next/cache/webpack' imported from /home/projects/node-d5jut7/pkg-b/
    at __node_internal_ (https://noded5jut7-fpux.w-credentialless.staticblitz.com/blitz.6843a59c.js:36:5406)
    at new <anonymous> (https://noded5jut7-fpux.w-credentialless.staticblitz.com/blitz.6843a59c.js:36:4168)
    at https://noded5jut7-fpux.w-credentialless.staticblitz.com/blitz.6843a59c.js:114:12002
    at https://noded5jut7-fpux.w-credentialless.staticblitz.com/blitz.6843a59c.js:114:12159
    at defaultResolve (https://noded5jut7-fpux.w-credentialless.staticblitz.com/blitz.6843a59c.js:114:12167)
    at nextResolve (https://noded5jut7-fpux.w-credentialless.staticblitz.com/blitz.6843a59c.js:248:2120)
    at h (file:///home/projects/node-d5jut7/pkg-b/node_modules/.pnpm/@esbuild-kit+esm-loader@2.5.0/node_modules/@esbuild-kit/esm-loader/dist/index.js:19:2612)
    at U (file:///home/projects/node-d5jut7/pkg-b/node_modules/.pnpm/@esbuild-kit+esm-loader@2.5.0/node_modules/@esbuild-kit/esm-loader/dist/index.js:19:1536)
    at N (file:///home/projects/node-d5jut7/pkg-b/node_modules/.pnpm/@esbuild-kit+esm-loader@2.5.0/node_modules/@esbuild-kit/esm-loader/dist/index.js:19:1766)
    at h (file:///home/projects/node-d5jut7/pkg-b/node_modules/.pnpm/@esbuild-kit+esm-loader@2.5.0/node_modules/@esbuild-kit/esm-loader/dist/index.js:19:2711)
    at async nextResolve (https://noded5jut7-fpux.w-credentialless.staticblitz.com/blitz.6843a59c.js:248:2114)
    at async ESMLoader.resolve (https://noded5jut7-fpux.w-credentialless.staticblitz.com/blitz.6843a59c.js:248:7550)
    at async ESMLoader.getModuleJob (https://noded5jut7-fpux.w-credentialless.staticblitz.com/blitz.6843a59c.js:248:4376) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Screenshot 2023-11-27 at 13 39 39

Removing the --ignore option causes the program to run through:

$ pnpm tsx watch index.ts
a 1

Expected behavior

Imported modules / packages / files can still be located if they are a part of the --ignore specifier

Minimal reproduction URL

https://stackblitz.com/edit/node-d5jut7?file=pkg-b%2Findex.ts&file=pkg-a%2F.next%2Fcache%2Fwebpack%2Ffile.ts

Version

v4.5.0

Node.js version

v18.18.0

Package manager

pnpm

Operating system

Linux

Contributions

  • I plan to open a pull request for this issue
  • I plan to make a financial contribution to this project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage
Projects
None yet
Development

No branches or pull requests

1 participant