Closed
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Affected package
Steps to reproduce
The following example is a vanilla TS project running the example from this repo's README.md
. The error is encountered when trying to build the project with npm run build
.
https://stackblitz.com/edit/vitejs-vite-a7aqha48?file=src%2Fmain.ts
- Open the stackblitz demo.
ctrl + c
in terminal to stop vite dev server.npm run build
to view error.
Actual behavior
The following error is observed after running npm run build
in the terminal on the Stackblitz link above.
node_modules/unist-util-find-before/lib/index.d.ts:14:86 - error TS2307: Cannot find module '../node_modules/unist-util-is/lib/index.js' or its corresponding type declarations.
14 export const findBefore: (<Kind extends import("unist").Parent, Check extends import("../node_modules/unist-util-is/lib/index.js").Test>(parent: Kind, index: number | Child<Kind>, test: Check) => Matches<Child<Kind>, Check> | undefined) & (<Kind_1 extends import("unist").Parent>(parent: Kind_1, index: number | Child<Kind_1>, test?: null | undefined) => Child<Kind_1> | undefined);
Found 1 error in node_modules/unist-util-find-before/lib/index.d.ts:14
Expected behavior
Running npm run build
in unist-util-find-before
repository produces the following on line:14
of lib/index.d.ts
.
export const findBefore: ((<Kind extends UnistParent, Check extends Test>(parent: Kind, index: Child<Kind> | number, test: Check) => Matches<Child<Kind>, Check> | undefined) & (<Kind extends UnistParent>(parent: Kind, index: Child<Kind> | number, test?: null | undefined) => Child<Kind> | undefined));
The npm
version of this file contains a path on line:14
.
https://www.npmjs.com/package/unist-util-find-before?activeTab=code
Runtime
Package manager
Operating system
macOS Sequoia 15.1
Build and bundle tools
Vite