Skip to content

Fix broken link for p5js references in FES Messages in console #7244

@computationalmama

Description

@computationalmama

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

1.10.0

Web browser and version

128.0.6613.119 (Official Build) (arm64)

Operating system

MacOSX Sonoma 14.5

Steps to reproduce this

Steps:

  1. Test simple shape function like circle(100,100, ) - intentionally not added diameter parameter
  2. Run sketch - open console
  3. FES message shows wrong reference link (still links to archive p5js website not the new one)

NOTE: This error shows up in locally run sketch and in the p5.js web editor

Old links for reference was http://p5js.org/reference/#/p5/circle and now with the revamped website it should be https://p5js.org/reference/p5/circle/

FESlink2

FESlink1

Solution

Requires a small edit in the FES core file src/core/friendly_errors/fes_core.js and possibly src/core/friendly_errors/sketch_reader.js

Reference links here

msgWithReference = `${message} (http://p5js.org/reference/#/${referenceSection}.${funcName})` :

let url = `https://p5js.org/reference/#/p5/${variableArray[i]}`;

Snippet:

I believe this is the change needed - but I would need some guidance to share the PR for this.

// line 147 
//Whenever func having p5.[Class] is encountered, we need to have the error link as mentioned below else different link
funcName.startsWith('p5.')  ?
   msgWithReference = `${message} (https://p5js.org/reference/${referenceSection}.${funcName})` :
   msgWithReference = `${message} (https://p5js.org/reference/${referenceSection}/${funcName})`;
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions