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.jsfile to your apps/publicfolder.Put your
recorder.jsfile anywhere within your apps/clientfolder.Open up your
recorder.jsfile and edit theWORKER_PATHvariable tovar WORKER_PATH = '/recorderWorker.js';