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

Files to paths are not possible? (ENOTDIR: not a directory) #9

Open
cdauth opened this issue Dec 22, 2023 · 2 comments
Open

Files to paths are not possible? (ENOTDIR: not a directory) #9

cdauth opened this issue Dec 22, 2023 · 2 comments

Comments

@cdauth
Copy link

cdauth commented Dec 22, 2023

I have the following tsconfig.json:

{
	"extends": "../tsconfig.base.json",
	"compilerOptions": {
		"outDir": "./out",
		"composite": true,
		"paths": {
			"facilmap-types": ["../types/src/index.ts"],
			"facilmap-utils": ["../utils/src/index.ts"]
		}
	},
	"references": [
		{ "path": "../types/tsconfig.json" },
		{ "path": "../utils/tsconfig.json" }
	],
	"include": [
		"src/**/*",
		"vite.config.ts",
		"esrun-server.ts"
	]
}

This leads to the following error:

✘ [ERROR] ENOTDIR: not a directory, scandir '/home/cdauth/Documents/workspace/programming/web/osm/facilmap/utils/src/index.ts' [plugin esbuild-ts-paths]

    ../node_modules/@nodelib/fs.scandir/out/providers/sync.js:16:32:
      16 │     const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
         ╵                                 ^

    at Object.readdirSync (node:fs:1517:26)
    at readdirWithFileTypes (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@nodelib/fs.scandir/out/providers/sync.js:16:33)
    at Object.read (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@nodelib/fs.scandir/out/providers/sync.js:10:16)
    at SyncReader.scandirSync [as _scandir] (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@nodelib/fs.scandir/out/index.js:18:17)
    at SyncReader._handleDirectory (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@nodelib/fs.walk/out/readers/sync.js:28:34)
    at SyncReader._handleQueue (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@nodelib/fs.walk/out/readers/sync.js:23:18)
    at SyncReader.read (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@nodelib/fs.walk/out/readers/sync.js:15:14)
    at SyncProvider.read (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@nodelib/fs.walk/out/providers/sync.js:11:29)
    at ReaderSync.walkSync [as _walkSync] (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@nodelib/fs.walk/out/index.js:20:21)
    at ReaderSync.dynamic (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/fast-glob/out/readers/sync.js:13:21)

  This error came from the "onResolve" callback registered here:

    ../node_modules/esbuild-ts-paths/index.js:21:12:
      21 │       build.onResolve({ filter: re }, (args) => {
         ╵             ~~~~~~~~~

    at setup (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/esbuild-ts-paths/index.js:21:13)
    at handlePlugins (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@digitak/esrun/node_modules/esbuild/lib/main.js:1279:21)
    at buildOrContextImpl (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@digitak/esrun/node_modules/esbuild/lib/main.js:968:5)
    at Object.buildOrContext (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@digitak/esrun/node_modules/esbuild/lib/main.js:776:5)
    at /home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@digitak/esrun/node_modules/esbuild/lib/main.js:2172:68
    at new Promise (<anonymous>)
    at Object.context (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@digitak/esrun/node_modules/esbuild/lib/main.js:2172:27)
    at context (/home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@digitak/esrun/node_modules/esbuild/lib/main.js:2012:58)
    at Runner.build (file:///home/cdauth/Documents/workspace/programming/web/osm/facilmap/node_modules/@digitak/esrun/runners/Runner.js:67:39)

  The plugin "esbuild-ts-paths" was triggered by this import

    src/webserver.ts:12:33:
      12 │ import { normalizePadName } from "facilmap-utils";

I suppose this means that file paths in tsconfig are not supported right now?

@cdauth cdauth changed the title Files to paths are not possible? Files to paths are not possible? (ENOTDIR: not a directory) Dec 22, 2023
@frankleng
Copy link
Owner

only directories are supported rn. happy to add file support if u give me a repo to test against

@frankleng
Copy link
Owner

frankleng commented Dec 26, 2023

@cdauth try [email protected] haven't tested myself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants