ytbryan / emd

📝 Embeddable markdown with Syntax Highlighting in Rails 5+ products
MIT License
26 stars 8 forks source link

emd.js assets:compile error #17

Closed jwgrenning closed 3 years ago

jwgrenning commented 3 years ago

Hi

I copied emd.js into my app/assets/javascripts directory and I get an error about ()

app/assets/javascripts/emd.js
ExecJS::ProgramError: Unexpected token: punc ()) (line: 1, col: 47, pos: 47)

If I comment out all lines in emd.js the asset precompile works fine.

Do you have any ideas on what I am doing wrong?

jwgrenning commented 3 years ago

Looks like rake assets:precompile in rails 4.2.6 does not recognize the lambda.

I changed document.addEventListener('DOMContentLoaded', () => { to document.addEventListener('DOMContentLoaded', function() { and the error went away.

I guess it's time for me to update rails.