8000 Could not find a declaration file for module `just-pipe` · Issue #562 · angus-c/just · GitHub
[go: up one dir, main page]

Skip to content

Could not find a declaration file for module just-pipe #562

Open

Description

@terrygonguet

Hi, thanks, love the packages!

I'm using a pretty basic vite vanilla typescript setup and just-pipe@1.0.0 causes an interesting error:

error TS7016: Could not find a declaration file for module 'just-pipe'. 'C:/Users/.../node_modules/.pnpm/just-pipe@1.0.0/node_modules/just-pipe/index.mjs' implicitly has an 'any' type.
There are types at 'C:/Users/.../node_modules/just-pipe/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'just-pipe' library may need to update its package.json or typings.

The error goes away if I edit just-pipe's package.json to look like just-compose's:

  "exports": {
    ".": {
      "require": "./index.js",
      "default": "./index.mjs",
+     "types": "./index.d.ts"
    }
  },
Here's my tsconfig.json if it helps.
{
	"compilerOptions": {
		"target": "ES2020",
		"useDefineForClassFields": true,
		"module": "ESNext",
		"lib": ["ES2020", "DOM", "DOM.Iterable"],
		"skipLibCheck": true,

		/* Bundler mode */
		"moduleResolution": "node16",
		"allowImportingTsExtensions": true,
		"allowSyntheticDefaultImports": true,
		"resolveJsonModule": true,
		"isolatedModules": true,
		"declaration": true,
		"emitDeclarationOnly": true,
		"outDir": "./types",

		/* Linting */
		"strict": true,
		"noUnusedLocals": true,
		"noUnusedParameters": true
	},
	"include": ["src"]
}

I've always been quite confused about how to specify types in package.json but this one seems like a simple fix.

Activity

  1. uncenter commented on Sep 27, 2023

    @uncenter

    Yeah you can see the issue on arethetypeswrong.github.io - looks like quite a few of these packages are published incorrectly. I'll try to make a PR at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branch 32B9 es or pull requests

      Issue actions

      0