Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails when using Two.js (0.8.10) template #158

Open
cdaein opened this issue Jun 11, 2022 · 3 comments
Open

build fails when using Two.js (0.8.10) template #158

cdaein opened this issue Jun 11, 2022 · 3 comments

Comments

@cdaein
Copy link

cdaein commented Jun 11, 2022

I will have to ping you again 🙏 - @jonobr1

This also might be related to the 0.8.x update as the sketch builds fine with 0.7.x.

Reproducing the problem:

create a sketch with Two.js v.0.8.10 template:

canvas-sketch sketch.js --new --open --template=two

build the sketch:

canvas-sketch sketch.js --dir build --build 

gets an error on CLI:

  → Building...  

SyntaxError: Unexpected token: operator (=)
At line 2333 and column 12 of generated bundle
  ...
  2331:   // src/events.js
  2332:   var Events = class {
  2333:     _events = {};
                   ^
  2334:     _bound = false;
  2335:     constructor() {
  ...
@jonobr1
Copy link
Contributor

jonobr1 commented Jun 11, 2022

This has to do with the build configuration. It doesn't support ES6 definitions. I'm away from the computer today, but I'll take a look and try to commit a PR for this.

@jonobr1
Copy link
Contributor

jonobr1 commented Jun 19, 2022

Perhaps if the microbundler package is updated to the latest this would be fixed. More soon.

@jonobr1
Copy link
Contributor

jonobr1 commented Jun 19, 2022

An alternative is to re-target Two.js export with ES5 compatibility so that public field declarations aren't defined that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants