You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { test } from 'src/util/some-module'
console.log(test())
I get
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'src' imported from ...elided.../scripts/src/some-utility/main.ts
at __node_internal_captureLargerStackTrace (node:internal/errors:465:5)
at new NodeError (node:internal/errors:372:5)
at packageResolve (node:internal/modules/esm/resolve:908:9)
at moduleResolve (node:internal/modules/esm/resolve:957:20)
at defaultResolve (node:internal/modules/esm/resolve:1173:11)
at u (file://...elided.../scripts/src/some-utility/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:2362)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async J (file://...elided.../scripts/src/some-utility/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:1584)
at async u (file://...elided.../scripts/src/some-utility/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:2512)
at async ESMLoader.resolve (node:internal/modules/esm/loader:604:24)
at async ESMLoader.getModuleJob (node:internal/modules/esm/loader:318:7)
at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:82:21)
at async Promise.all (index 0)
at async link (node:internal/modules/esm/module_job:87:9) {
code: 'ERR_MODULE_NOT_FOUND'
I can import types from src but actual code fails to load for whatever reason. Running tsc for type checking passes but eslint complains so maybe this is something weird with my TSC & not specific to tsx? I'm at a loss though.
...elided.../scripts/src/some-utility/main.ts
4:13 error Unsafe call of an `any` typed value @typescript-eslint/no-unsafe-call
Reproduction
I have the following (simplified) directory layout:
Can you provide a link to a minimal reproduction repository?
What you provided is not sufficient. If it's a single file or two, I wouldn't mind to re-create it, but you have a bunch of files and only of tsconfigs. Nothing I can run to reproduce and debug.
Bug description
When I run this:
I get
I can import types from
src
but actual code fails to load for whatever reason. Runningtsc
for type checking passes but eslint complains so maybe this is something weird with my TSC & not specific to tsx? I'm at a loss though.Reproduction
I have the following (simplified) directory layout:
All the source in the project is TypeScript using ESM modules. The tsconfig for some-utility looks like this:
The referenced tsconfig is:
src/tsconfig
is as follows:The tsconfig it inherits is:
Environment
System: OS: Linux 5.16 Arch Linux CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz Memory: 3.54 GB / 31.07 GB Container: Yes Shell: 5.1.16 - /bin/bash Binaries: Node: 17.9.0 - /usr/bin/node Yarn: 1.22.19 - /usr/bin/yarn npm: 8.5.5 - /usr/bin/npm npmPackages: tsx: ^3.4.3 => 3.4.3
Can you contribute a fix?
The text was updated successfully, but these errors were encountered: