Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught SyntaxError: Unexpected token '<' #1357

Closed
bnewland opened this issue Aug 21, 2013 · 3 comments
Closed

Uncaught SyntaxError: Unexpected token '<' #1357

bnewland opened this issue Aug 21, 2013 · 3 comments

Comments

@bnewland
Copy link

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.

@glasser
Copy link
Contributor

glasser commented Sep 4, 2013

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).

@glasser glasser closed this as completed Sep 4, 2013
@manojpanke
Copy link

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

@Haojen
Copy link

Haojen commented Jul 7, 2018

I have some solution too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants