I'm using Recorder.js with Meteor for client-side audio recording, and it works wonderfully in development. However, when I run in production, the web worker associated with Recorder throws a syntax error:
unexpected token '<'.
I think it has something to do with concatenation of Javascript files in production mode, because the file has already been minified (works in development after minifying). A look at the development console shows,
Resource interpreted as Script but transferred with MIME type text/html: "http://myapp:3000/client/compatibility/recorderWorker.min.js".
I experienced the same errors/issue while trying to implement Recorder.js in Meteor. After fiddling around with it a bit, I have Recorder.js working well in Meteor by performing the following steps:
Move the
recorderWorker.js
file to your apps/public
folder.Put your
recorder.js
file anywhere within your apps/client
folder.Open up your
recorder.js
file and edit theWORKER_PATH
variable tovar WORKER_PATH = '/recorderWorker.js';