rive-app / rive-app/rive-react
@rive-app/react-canvas mocking error with Vitest
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 58
- Avg merge
- 3h 23m
- Merged PRs (30d)
- 6
Description
Currently seeing the following error when running with Vitest.
[vitest] vi.mock(“@rive-app/react-canvas”, factory?: () => unknown) is not returning an object. Did you mean to return an object with a “default” key.
Stack:
- Vite 5.3.3
- Vitest 2.01
- @rive-app/canvas 4.13.3
- yarn 1.22.22
- MacOS 13.6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Vitest mocking error with the listed Vite, Vitest, and @rive-app/canvas versions, then inspect the test mock for @rive-app/react-canvas. Done means the mock runs without the reported non-object return error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100