P5-wrapper / next

A NextJS specific library for the @P5-Wrapper/react project.
MIT License
38 stars 2 forks source link

Failed loading p5 wrapper #49

Closed aerlaut closed 10 months ago

aerlaut commented 10 months ago

Expected Behavior

p5.js canvas can be inserted into page

Actual Behavior

Wrapper failed to load, throwing the error:

./node_modules/@p5-wrapper/react/dist/component/react.js
Module parse failed: Identifier 'je' has already been declared (7762:41)
|                                 if (F ? k || ($ = !0, A(), k = !0) : $ = !!je.first, H = Math.max(0, Math.floor(H)), Q = Math.max(0, Math.floor(Q)), $) {
|                                     if (!re) throw new Error("First frame must include a { palette } option");
>                                     var [je, we, fe, De, he = 8] = [
|                                         G,
|                                         H,

Import trace for requested module:
[./node_modules/@p5-wrapper/react/dist/component/react.js](mailto:./node_modules/@p5-wrapper/react/dist/component/react.js)
[./node_modules/@p5-wrapper/next/dist/next.js](mailto:./node_modules/@p5-wrapper/next/dist/next.js)
./components/Canvas.tsx
./app/page.tsx

Steps to Reproduce the Problem

  1. Install @p5-wrapper/next
  2. Include <NextReactP5Wrapper /> component into page

Specifications

Package Version: 1.0.2 Next Version: 14.1.0

aerlaut commented 10 months ago

Ah, turns out this is a duplicate of: https://github.com/P5-wrapper/react/issues/314.