Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.4k stars 976 forks source link

ToneJS doesn't work with `react-script 5.0` #1033

Closed jtwigg closed 2 years ago

jtwigg commented 2 years ago

I provided a very simple demo project of this failing. https://github.com/jtwigg/ToneJSReact

This was built using an up to date React app using the below template. It is using react-script@5.0 https://github.com/blackarctic/create-react-app

I installed tone@next and made a simple onAction: () => { Tone.start() function call

now npm run build fails with:

Attempted import error: 'start' is not exported from 'tone' (imported as 'Tone').

"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "5.0.0",
npm:7.24.2
node:v14.18.1

Any suggestions?

tambien commented 2 years ago

Try installing tone@next and see if that fixes the issue. The exports are handled slightly differently in the next version.

jtwigg commented 2 years ago

@tambien I will do.

jtwigg commented 2 years ago

That seemed to do the trick. I've got everything upgraded. Cheers