processing / processing/p5.js

[p5.js 2.0+ Bug Report]: Missing type declarations

Open
#9,190 0 comments 1 reaction 0 assignees View on GitHub

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:
  1. install p5js via npm i p5
  2. create a sketch.ts file and add import p5 from "p5" or import "p5/global"
  3. Get the error Could not find a declaration file for module 'p5'
  4. look in the package.json to see there are types declared
  5. open the p5 folder in node_modules and find the files missing
  6. Surprised Pikachu Face
Snippet:

import p5 from "p5";

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.