Thursday, 8 November 2012

PDF.js and the Rails Asset Pipeline

is a cool javascript library that lets you display and do stuff with files directly in the browser. Unfortunately, it doesn't play well with the , or more specifically  (the default library for the asset pipeline). The problem appears when you precompile your assets for production and comes in the form of a syntax error in your javascript complaining about Octal literals.

The only solution we could manage was to turn off javascript compression when using PDF.js, but it might be that one of the other javascript compression libraries wouldn't generate the same issue.