Meteor: Uncaught SyntaxError: Unexpected token '<'

Created on 21 Aug 2013  路  3Comments  路  Source: meteor/meteor

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 (the aforementioned "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 also shows, "Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3000/client/compatibility/recorderWorker.min.js"." Any help would be really appreciated.

Most helpful comment

I have to record audio on browser and i am using recorderWorker.js but this file gives me "Uncaught SyntaxError: Unexpected token <". Please help me for solution

All 3 comments

Web worker code may be JavaScript, but it's fundamentally different from normal Meteor client JS code. Instead of linking it together with the rest of your app, it needs to be unprocessed and separately fetchable. It should be treated as a static asset instead. So put it in your public directory (or if this is a package, pass the {isAsset: true} option to api.add_files).

I have to record audio on browser and i am using recorderWorker.js but this file gives me "Uncaught SyntaxError: Unexpected token <". Please help me for solution

I have some solution too

Was this page helpful?
0 / 5 - 0 ratings