Error when attempting to import Tone.js into vanilla JS script

70 Views Asked by At

I'm trying to import Tone.js into my vanilla Javascript code. I am following the documentation on how to import it:

  • Run npm install tone in the directory of the file
  • And adding import * as Tone from 'tone' in the beginning of my Javascript file.

However, the error I'm getting in my console is: Uncaught TypeError: The specifier “tone” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.

I tried changing the path to the different folders within node_modules but nothing helped. I tried adding ./ and ./node_modules but it did not help

0

There are 0 best solutions below