0

I've been totally unsuccessful in getting Opal to work.

When I try to embed it in a Sinatra server using the tutorial here or the example code here, I get undefined method 'source_maps' for #<Opal::Server:0x8b11540>. When I use the updated code linked at the bottom of this post, I get uninitialized constant Opal::Sprockets::SourceMapHeaderPatch.

So, I abandon Sinatra and try using Opal in a Rack app instead, using their own example here. And I get a totally blank webpage.

Finally, I follow the tutorial here to the letter, and again all I get is a blank page in my browser.

So, what am I doing wrong? Or is Opal really as broken as it appears?

(oh, and that's not even mentioning the two serious out-of-bounds bugs in the rescue block in parse() in opal/parser.rb that completely kill any chance of debugging an error)

Sod Almighty
  • 1,768
  • 1
  • 16
  • 29
  • Can you share your code with us? So we can check it. I have most experience with running it Rails but might be able to help – gabrielrios Jun 22 '15 at 15:04
  • I think part of your problem might be that you're trying to use source maps... they've been acting kind of funky in recent versions. Also, as @gabrielrios said, it would be good to share some code so that we can determine exactly what the problem is. – GDP2 Jun 28 '15 at 21:27

1 Answers1

1

The documentation needs to be updated and versioned.

But 0.8 rc1 seems pretty stable and has working examples here (including source maps).

Keep in mind that source maps are kinda hacked into sprockets and the rack setup to get them working isn't trivial.

Elia Schito
  • 989
  • 7
  • 18