glicol icon indicating copy to clipboard operation
glicol copied to clipboard

Help config Angular for Glicol

Open BoogieMonsta opened this issue 1 year ago • 4 comments

Hello,

In my Angular app, I have taken the following steps:

  • npm i glicol
  • declare module 'glicol' in my custom types file ./src/types/custom.d.ts
  • import Glicol from 'glicol' in my main component
  • const glicol = new Glicol() in my main component

Unfortunately, upon executing npm start I get the following errors:

./node_modules/glicol/index.js:141:23-27 - Error: export 'default' (imported as 'wasm') was not found in './glicol_wasm.wasm?init' (possible exports: __data_end, __heap_base, add_sample, alloc, alloc_uint8array, live_coding_mode, memory, process, reset, send_msg, set_bpm, set_seed, set_sr, set_track_amp, update)

./node_modules/glicol/glicol_wasm.wasm?init - Error: Module not found: Error: Can't resolve 'env' in '/Users/boogie/IdeaProjects/pauseTape/node_modules/glicol'

Any idea what to do about that? Am I supposed to customize my webpack config?

Thanks in advance!

BoogieMonsta avatar May 30 '23 12:05 BoogieMonsta

I am sorry that I am not familiar with Webpack. The npm package is currently only targeting vite. I plan to separate the js part from this repo so that people can do PR there.

chaosprint avatar Jun 01 '23 18:06 chaosprint

I'm running into this issue as well with Webpack and React

wallzero avatar Jul 26 '24 19:07 wallzero

I'm running into this issue as well with Webpack and React

I tried pnpm create vite for react it works fine. Webpack might handle wasm in a different way.

chaosprint avatar Jul 27 '24 14:07 chaosprint

Yeah I think it does. I haven't used wasm before. Is vite used to create the wasm package? It seems like webpack is missing an 'env' path.

wallzero avatar Jul 29 '24 22:07 wallzero