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). Is there a way to exclude some files from Uglify? 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".
When inspecting the recorderWorker.js file from either Chrome or Safari's consoles, it shows up as an html document. This is not the case in development. Any ideas?
You should put web workers in the public directory so they are considered as static assets and not as Meteor JS code.
--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meteor-talk...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Meteor.saveFile = function(blob, name, path, type, callback) {var fileReader = new FileReader(),method, encoding = 'binary', type = type || 'binary';switch (type) {case 'text':method = 'readAsText';encoding = 'utf8';break;case 'binary':method = 'readAsBinaryString';encoding = 'binary';break;default:method = 'readAsBinaryString';encoding = 'binary';break;}fileReader.onload = function(file) {var form = new FormData();form.append("blob", blob, name);var request = new XMLHttpRequest();request.open("POST","http://ourDomain.com:9000",true);request.send(form);console.log('this be my '+name);Meteor.call('mo_upload', name);downloadname = name;this.downloadname= downloadname;console.log(downloadname);}fileReader[method](blob);}