rive-app / rive-app/rive-react

@rive-app/react-canvas mocking error with Vitest

Open
#277 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.