-
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
💪 phase/solvedPost is donePost is done
Description
Initial checklist
- I read the support docsI read the contributing guideI agree to follow the code of conductI searched issues and discussions and couldn’t find anything (or linked relevant results below)To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Affected package
unist-util-find-before@4.0.0
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
node@22.12.0
Package manager
npm@10.9.0
Operating system
macOS Sequoia 15.1
Build and bundle tools
Vite
Metadata
Metadata
Assignees
Labels
💪 phase/solvedPost is donePost is done
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
ChristianMurphy commentedon Jan 1, 2025
The dependency is declared
unist-util-find-before/package.json
Line 35 in 785e58c
The import looks correct in the source
unist-util-find-before/lib/index.js
Line 8 in 785e58c
But I do see the update path on NPM https://www.npmjs.com/package/unist-util-find-before?activeTab=code
This feels like a tsc bug.
Maybe one that would be fixed by rebuilding the declarations with a newer version
wooorm commentedon Jan 2, 2025
tsc
sometimes used to generate that. It is often better now. But not always. Let me seewooorm commentedon Jan 2, 2025
new release should work! https://github.com/syntax-tree/unist-util-find-before/releases/tag/4.0.1
jamesgeorgewilliams commentedon Jan 2, 2025
Great. Thanks!