Skip to content

Failure to construct p5 in instance mode when using custom bundles (combineModules) #3883

@hsab

Description

@hsab

When creating a custom bundle using combineModules, p5 fails to instantiate with the error:
p5 is not a constructor

Nature of issue?

  • Found a bug

Most appropriate sub-area of p5.js?

  • Build system

Which platform were you using when you encountered this?

  • Desktop/Laptop

Details about the bug:

  • p5.js version: 99252b9
  • Web browser and version: Chrome 75.0.3770.100
  • Steps to reproduce this:
    npm run grunt combineModules:core/shape:color:math:image
    Use the following for sketch.js in emptyExample
    const s = ( sketch ) => {
    
      let x = 100;
      let y = 100;
    
      sketch.setup = () => {
        sketch.createCanvas(200, 200);
      };
    
      sketch.draw = () => {
        sketch.background(0);
        sketch.fill(255);
        sketch.rect(x,y,50,50);
      };
    };
    
    let myp5 = new p5(s);
    
    Results in error p5 is not a constructor

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions