[p5.js 2.0+ Bug Report]: Missing type declarations
Open
Nobody has claimed this yet.
Area:Accessibility
Area:Utilities
p5.js 2.0+
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- WebGPU
- p5.strands
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.3.3
Web browser and version
No response
Operating system
No response
Steps to reproduce this
Steps:
- install p5js via
npm i p5 - create a
sketch.tsfile and addimport p5 from "p5"orimport "p5/global" - Get the error
Could not find a declaration file for module 'p5' - look in the package.json to see there are
typesdeclared - open the
p5folder innode_modulesand find the files missing - Surprised Pikachu Face
Snippet:
import p5 from "p5";
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 with package.json and the installed p5 folder described in the report, then reproduce the TypeScript import error with the provided sketch.ts example. Trace the declared types entry and verify that the published package contains the referenced declaration files and that both import forms type-check successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100