Compile assets fails - Unexpected token

56 views
Skip to first unread message

Jorge Herskovic

unread,
Aug 23, 2016, 3:31:45 PM8/23/16
to Canvas LMS Users
Driving me crazy - I can't compile assets due to a supposed syntax error in CoursesList.jsx. I've tried different versions of Node (0.12 and 6.4) on different version of Ubuntu (14.04LTS and 16.04LTS) and worked through similar tutorials online to no avail. I'm running ruby 2.1.8. This is a clean VM with nothing else on it.

Things I tried without success: npm install in canvas_i18nliner (a common "cure" for similar errors in several posts). Installing 'missing' packages according to npm output, most importantly react and react-dom ~15.1.0; setting locale environment variables properly before compiling assets; the origin/stable and origin/master branches. None of this seems to make a difference.  
 
rake aborted!
Undumpable Exception -- #<RuntimeError: SyntaxError: /opt/canvas/app/jsx/account_course_user_search/CoursesList.jsx: Unexpected token (39:8)
  37 |       return (
  38 |
> 39 |         <div className="content-box" role='grid'>
     |         ^
  40 |           <div role='row' className="grid-row border border-b pad-box-mini">
  41 |             <div className="col-xs-5">
  42 |               <div className="grid-row">
>
/opt/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:63:in `work'
/opt/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:280:in `block (4 levels) in work_in_processes'
/opt/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:447:in `with_instrumentation'
/opt/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:279:in `block (3 levels) in work_in_processes'
/opt/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:273:in `loop'
/opt/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:273:in `block (2 levels) in work_in_processes'
/opt/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:138:in `block (2 levels) in in_threads'
Tasks: TOP => canvas:compile_assets
(See full trace by running task with --trace)

Any suggestions will be more than welcome.

Graham Ballantyne

unread,
Aug 23, 2016, 3:45:25 PM8/23/16
to canvas-l...@googlegroups.com
You're most likely missing the .babelrc file from your Canvas root. An older version of the Production Start guide gave instructions for copying the repo in such a way that dot-files are skipped. I updated the docs last week. 


-- 
Graham Ballantyne 
IT Services 
Simon Fraser University 
--

---
You received this message because you are subscribed to the Google Groups "Canvas LMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to canvas-lms-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jorge Herskovic

unread,
Aug 23, 2016, 4:11:55 PM8/23/16
to Canvas LMS Users
Thanks Graham - I was indeed using ansible's clone module. Gonna try with the command-line git client and report back.

Jorge Herskovic

unread,
Aug 23, 2016, 4:39:01 PM8/23/16
to Canvas LMS Users
It wasn't that. It was that I was using 
cp -a * /opt/canvas 
to copy my files, instead of
cp -a . /opt/canvas

so, my bad. Thanks so much for the help.


On Tuesday, August 23, 2016 at 2:45:25 PM UTC-5, Graham Ballantyne wrote:

Graham Ballantyne

unread,
Aug 23, 2016, 4:49:22 PM8/23/16
to canvas-l...@googlegroups.com
The docs used to use `cp -a *`. I changed them last week to `cp -a .`.


Reply all
Reply to author
Forward
0 new messages