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 ) #920

Closed
lefnire opened this issue May 9, 2013 · 5 comments · Fixed by derbyjs/racer#130
Closed

Uncaught SyntaxError: Unexpected token ) #920

lefnire opened this issue May 9, 2013 · 5 comments · Fixed by derbyjs/racer#130

Comments

@lefnire
Copy link
Contributor

lefnire commented May 9, 2013

and users can't interact with the page at all. only happens when process.env.NODE_ENV=='production', so both sites are set to development right now (obviously not optimal). Looks like some mini / concat issue - my hunch was Browserify, but again that's frozen at 1.17.3. I've narrowed it down to store.query.expose... that causes it - any exposed paths, any arguments, any function body. This happens even in minimal Derby example apps.

Something in derby/node_modules or racer/node_modules as far as I can tell. I did git bisect on habit's codebase, as well as Unroll-Me/derby & SLaks/racer , but didn't find anything there, so I assume nested module somewhere

@lefnire
Copy link
Contributor Author

lefnire commented May 9, 2013

@SLaks might want to be aware of this for Unroll-Me. Same situation as the model.uuid() bug - aka, not a Racer issue as far as I can tell, but may effect you nonetheless

@SLaks
Copy link

SLaks commented May 9, 2013

At Unroll.me, we had a similar issue that turned out to be a bug in UglifyJS (the minifier used by Racer).

mishoo/UglifyJS#153

store.query.expose is tricky; it sends the body of the function (from toString()) to the client, which evals it to create the client-side query.

@lefnire
Copy link
Contributor Author

lefnire commented May 9, 2013

sure enough, pinning 2.3.1 (previous Uglify version) fixed the issue. As always, you are my hero @SLaks!

@lefnire lefnire closed this as completed May 9, 2013
SLaks added a commit to SLaks/racer that referenced this issue May 9, 2013
Uglify v2.3.2 transforms (function(){})() to !function(){}()
This breaks the slice() call.

Fixes HabitRPG/habitica#920
SLaks added a commit to SLaks/racer that referenced this issue May 9, 2013
Uglify v2.3.2 transforms (function(){})() to !function(){}()
This breaks the slice() call.

Fixes HabitRPG/habitica#920
@SLaks
Copy link

SLaks commented May 12, 2013

BTW, you can avoid this kind of issue in the future by using npm shrinkwrap to fix your dependency versions.

You can then use npm outdated to check for new versions and manually upgrade (and test) one dependency at a time.

@lefnire
Copy link
Contributor Author

lefnire commented May 12, 2013

Great. I think I'll check into doing that from now on, getting our Chef
setup to use that

On Sunday, May 12, 2013, SLaks wrote:

BTW, you can avoid this kind of issue in the future by using npm
shrinkwrap to fix your dependency versions.

You can then use npm outdated to check for new versions and manually
upgrade (and test) one dependency at a time.


Reply to this email directly or view it on GitHubhttps://github.com//issues/920#issuecomment-17770844
.

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

Successfully merging a pull request may close this issue.

2 participants