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

error: Is a directory (os error 21) #130

Closed
juliusmarminge opened this issue Mar 2, 2024 · 10 comments
Closed

error: Is a directory (os error 21) #130

juliusmarminge opened this issue Mar 2, 2024 · 10 comments
Assignees
Labels
bug Something isn't working publishing Problems with publishing

Comments

@juliusmarminge
Copy link

CleanShot 2024-03-02 at 14 07 59@2x

Understand this is vague, but I have no clue where to look, happy to provide any details you require to help out

@lucacasonato
Copy link
Member

Can you run ls and cat jsr.json and cat package.json?

@lucacasonato
Copy link
Member

And can you also run deno publish -Ldebug

@lucacasonato lucacasonato added the bug Something isn't working label Mar 2, 2024
@juliusmarminge
Copy link
Author

> ls
README.md                   http                        observable                  rpc                         subscription                tsconfig.json               unstableDontImportMe
adapters                    jsr.json                    package.json                shared                      tsconfig.benchmark.json     turbo.json
entrypoints.script.ts       node_modules                rollup.config.ts            src                         tsconfig.build.json         unstable-core-do-not-import

> cat jsr.json
{
  "name": "@trpc/server",
  "description": "The tRPC server library",
  "version": "0.0.6",
  "exports": {
    ".": "./src/@trpc/server/index.ts",
    "./adapters/aws-lambda": "./src/adapters/aws-lambda/index.ts",
    "./adapters/express": "./src/adapters/express.ts",
    "./adapters/fastify": "./src/adapters/fastify/index.ts",
    "./adapters/fetch": "./src/adapters/fetch/index.ts",
    "./adapters/next": "./src/adapters/next.ts",
    "./adapters/node-http/content-type/form-data": "./src/adapters/node-http/content-type/form-data/index.ts",
    "./adapters/node-http/content-type/json": "./src/adapters/node-http/content-type/json/index.ts",
    "./adapters/node-http": "./src/adapters/node-http/index.ts",
    "./adapters/standalone": "./src/adapters/standalone.ts",
    "./adapters/ws": "./src/adapters/ws.ts",
    "./http": "./src/http.ts",
    "./observable": "./src/observable/index.ts",
    "./rpc": "./src/rpc.ts",
    "./shared": "./src/shared.ts",
    "./unstable-core-do-not-import": "./src/unstable-core-do-not-import.ts"
  }
}

> cat package.json
{
  "name": "@trpc/server",
  "version": "10.45.1",
  "description": "The tRPC server library",
  "author": "KATT",
  "license": "MIT",
  "main": "dist/index.js",
  "module": "dist/index.mjs",
  "typings": "dist/index.d.ts",
  "homepage": "https://trpc.io",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/trpc/trpc.git",
    "directory": "packages/server"
  },
  "scripts": {
    "build": "rollup --config rollup.config.ts --configPlugin rollup-plugin-swc3",
    "dev": "pnpm build --watch",
    "codegen-entrypoints": "tsx entrypoints.script.ts",
    "benchmark": "tsc --project tsconfig.benchmark.json",
    "lint": "eslint --cache --ext \".js,.ts,.tsx\" --ignore-path ../../.gitignore src",
    "ts-watch": "tsc --watch"
  },
  "exports": {
    "./package.json": "./package.json",
    ".": {
      "import": "./dist/index.mjs",
      "require": "./dist/index.js",
      "default": "./dist/index.js"
    },
    "./adapters/aws-lambda": {
      "import": "./dist/adapters/aws-lambda/index.mjs",
      "require": "./dist/adapters/aws-lambda/index.js",
      "default": "./dist/adapters/aws-lambda/index.js"
    },
    "./adapters/express": {
      "import": "./dist/adapters/express.mjs",
      "require": "./dist/adapters/express.js",
      "default": "./dist/adapters/express.js"
    },
    "./adapters/fastify": {
      "import": "./dist/adapters/fastify/index.mjs",
      "require": "./dist/adapters/fastify/index.js",
      "default": "./dist/adapters/fastify/index.js"
    },
    "./adapters/fetch": {
      "import": "./dist/adapters/fetch/index.mjs",
      "require": "./dist/adapters/fetch/index.js",
      "default": "./dist/adapters/fetch/index.js"
    },
    "./adapters/next": {
      "import": "./dist/adapters/next.mjs",
      "require": "./dist/adapters/next.js",
      "default": "./dist/adapters/next.js"
    },
    "./adapters/node-http/content-type/form-data": {
      "import": "./dist/adapters/node-http/content-type/form-data/index.mjs",
      "require": "./dist/adapters/node-http/content-type/form-data/index.js",
      "default": "./dist/adapters/node-http/content-type/form-data/index.js"
    },
    "./adapters/node-http/content-type/json": {
      "import": "./dist/adapters/node-http/content-type/json/index.mjs",
      "require": "./dist/adapters/node-http/content-type/json/index.js",
      "default": "./dist/adapters/node-http/content-type/json/index.js"
    },
    "./adapters/node-http": {
      "import": "./dist/adapters/node-http/index.mjs",
      "require": "./dist/adapters/node-http/index.js",
      "default": "./dist/adapters/node-http/index.js"
    },
    "./adapters/standalone": {
      "import": "./dist/adapters/standalone.mjs",
      "require": "./dist/adapters/standalone.js",
      "default": "./dist/adapters/standalone.js"
    },
    "./adapters/ws": {
      "import": "./dist/adapters/ws.mjs",
      "require": "./dist/adapters/ws.js",
      "default": "./dist/adapters/ws.js"
    },
    "./http": {
      "import": "./dist/http.mjs",
      "require": "./dist/http.js",
      "default": "./dist/http.js"
    },
    "./observable": {
      "import": "./dist/observable/index.mjs",
      "require": "./dist/observable/index.js",
      "default": "./dist/observable/index.js"
    },
    "./rpc": {
      "import": "./dist/rpc.mjs",
      "require": "./dist/rpc.js",
      "default": "./dist/rpc.js"
    },
    "./shared": {
      "import": "./dist/shared.mjs",
      "require": "./dist/shared.js",
      "default": "./dist/shared.js"
    },
    "./unstable-core-do-not-import": {
      "import": "./dist/unstable-core-do-not-import.mjs",
      "require": "./dist/unstable-core-do-not-import.js",
      "default": "./dist/unstable-core-do-not-import.js"
    }
  },
  "files": [
    "dist",
    "src",
    "README.md",
    "package.json",
    "adapters",
    "http",
    "observable",
    "rpc",
    "shared",
    "unstable-core-do-not-import",
    "!**/*.test.*"
  ],
  "publishConfig": {
    "access": "public"
  },
  "dependencies": {},
  "peerDependencies": {},
  "devDependencies": {
    "@fastify/websocket": "^7.1.2",
    "@tanstack/react-query": "^5.0.0",
    "@types/aws-lambda": "^8.10.97",
    "@types/express": "^4.17.17",
    "@types/hash-sum": "^1.0.0",
    "@types/node": "^20.10.0",
    "@types/react": "^18.2.33",
    "@types/react-dom": "^18.2.14",
    "@types/ws": "^8.2.0",
    "@web3-storage/multipart-parser": "^1.0.0",
    "aws-lambda": "^1.0.7",
    "devalue": "^4.0.0",
    "eslint": "^8.56.0",
    "express": "^4.17.1",
    "fastify": "^4.13.0",
    "fastify-plugin": "^4.5.0",
    "hash-sum": "^2.0.0",
    "myzod": "^1.3.1",
    "next": "^14.0.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "rollup": "^4.9.5",
    "superjson": "^1.12.4",
    "superstruct": "^1.0.0",
    "tslib": "^2.5.0",
    "tsx": "^4.0.0",
    "typescript": "^5.3.3",
    "valibot": "^0.29.0",
    "vitest": "^1.2.2",
    "ws": "^8.0.0",
    "yup": "^1.0.0",
    "zod": "^3.0.0"
  },
  "funding": [
    "https://trpc.io/sponsor"
  ]
}

> deno publish -Ldebug
see https://app.warp.dev/block/UtSXtXFYHKh0qZXcqCGzrl

@lucacasonato
Copy link
Member

To reproduce, what repo / branch should I check out? Is it https://github.com/trpc/trpc/tree/pub-jsr and then deno publish in the packages/server/ directory?

@juliusmarminge
Copy link
Author

Yea, although i made some changes since the original post (mostly regarding imports)

@crowlKats crowlKats added the publishing Problems with publishing label Mar 2, 2024
@lucacasonato lucacasonato added this to JSR Mar 4, 2024
@github-project-automation github-project-automation bot moved this to Needs Plan in JSR Mar 4, 2024
@lucacasonato lucacasonato moved this from Needs Plan to Ready in JSR Mar 4, 2024
@lucacasonato lucacasonato removed the status in JSR Mar 4, 2024
@lucacasonato lucacasonato moved this to Ready in JSR Mar 4, 2024
@dsherret
Copy link
Member

dsherret commented Mar 8, 2024

This might be fixed or at least provide more information in the error in the latest release.

@lucacasonato
Copy link
Member

lucacasonato commented Mar 8, 2024

error: Is a directory (os error 21)
    at file:///mnt/artemis/Projects/github.com/trpc/trpc/packages/server/src/@trpc/server/index.ts:35:8

This is the current error. I know where the bug is, and I think I can get this fixed today.

The problem is that ../../unstable-core-do-not-import could resolve to either ./unstable-core-do-not-import/index.ts (doesn't exist), or ./unstable-core-do-not-import.ts. But our resolver is trying to use ./unstable-core-do-not-import (the folder) as the resolved path, which obviously does not work.

@juliusmarminge
Copy link
Author

Hey, sorry for kinda bailing out after submission. Just had other stuff to do 😅

Thanks for sorting it out, I also saw one of you left a comment on the PR over at trpc, I'll see if I can check it out again over the weekend and make a new attempt at publishing!

@lucacasonato
Copy link
Member

Bug fix: denoland/deno#22800

@lucacasonato
Copy link
Member

This was fixed by denoland/deno#22800

@github-project-automation github-project-automation bot moved this from Ready to Done in JSR Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working publishing Problems with publishing
Projects
Status: Done
Development

No branches or pull requests

4 participants