Git Product home page Git Product logo

Comments (11)

jeremyevans avatar jeremyevans commented on September 23, 2024

Can you get the backtrace for the error?

from roda.

cj avatar cj commented on September 23, 2024

here you go:


remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `initialize'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `open'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `read_template_file'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:68:in `block in initialize'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:69:in `call'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:69:in `initialize'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt.rb:61:in `new'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt.rb:61:in `new'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/render.rb:324:in `block in retrieve_template'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/render.rb:235:in `cached_template'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/render.rb:315:in `retrieve_template'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/render.rb:200:in `render'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:645:in `render_asset_file'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:617:in `read_asset_file'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:423:in `block in compile_assets_files'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:420:in `map'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:420:in `compile_assets_files'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:408:in `_compile_assets'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:405:in `block in _compile_assets'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:405:in `each_key'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:405:in `_compile_assets'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:379:in `compile_assets'�

remote:        /tmp/build_9f193afe940ec1cab65aa0020ab8699c/tasks/assets.rake:5:in `block (2 levels) in <top (required)>'�

from roda.

jeremyevans avatar jeremyevans commented on September 23, 2024

I can't reproduce this locally. If I add a call Roda.compile_assets after loading the plugin in that example, it works fine and serves the compiled assets.

This doesn't appear to be a bug in Roda, so I'm closing this now. If you still think it is an issue with roda-opal-example, you may want to open up an issue there, and you'll probably want to add more detail, like what changes you have made, whether it works without compilation, versions of software in use, etc..

from roda.

cj avatar cj commented on September 23, 2024

It works without pre-compiling. It only fails when running pre-compile. I'll try to come up with something so you can re-create it. Thank you for looking into it thus far.

from roda.

cj avatar cj commented on September 23, 2024

@jeremyevans so it appears the issue is grabbing files outside of the directory root on compile (i.e. in a gem). It finds the file just fine when it doesn't need to compile.

from roda.

jeremyevans avatar jeremyevans commented on September 23, 2024

The assets plugin only supports asset files that are under the directory root, or at least, it wasn't designed to support external asset files. Those asset files may load files outside the directory root, if the template engine supports it (opal does).

If you can create a reproducible example, I'll take a look, but you should probably post it on the Google Group and not here, unless you are sure it is a bug in Roda itself.

from roda.

cj avatar cj commented on September 23, 2024

@jeremyevans I'll put together something and post on the google group. thanks again!

from roda.

cj avatar cj commented on September 23, 2024

@jeremyevans ok, I've opened a google group post and a message on how to re-create the issue. https://groups.google.com/forum/#!topic/ruby-roda/brNjNkfxRZo

from roda.

cj avatar cj commented on September 23, 2024

@jeremyevans I think this ticket should be opened again as a bug. If the desired purpose of pre-compile is not to allow outside assets to be compiled, when running an application without pre-compiling the assets, it should not load/throw the same error; otherwise people will make the same mistake I did and expect it to compile just fine.

from roda.

jeremyevans avatar jeremyevans commented on September 23, 2024

Honestly, I'm not sure why it works in non-compiled mode, I would expect it to fail there as well. This is definitely not a bug, it was never intended to work with files outside the asset path, you were just getting lucky that it was working in non-compiled mode.

Serving regular assets and compiling assets use the same code path (#read_asset_file/render_asset_file), so I'm very surprised the behavior is different. The only thing I can think that would cause this is something modifying render behavior that is different at runtime than when you are compiling (and that would be a bug in the app, not in Roda).

If you can create a minimal self-contained example (not using wedge), I'll take a deeper look.

from roda.

jeremyevans avatar jeremyevans commented on September 23, 2024

That line in roda-opal-example just modifies the opal load path, not Roda's load path. If I uncomment the roda-opal-example line, it does fail in both compiled and non-compiled mode, but that's due to the Opal error, not due to a Roda issue:

! Unable to load application: Opal::Builder::MissingRequire: A file required by "/home/jeremy/code/roda-opal-example/assets/js/test.rb" wasn't found.
can't find file: "opal/jquery" in ["/usr/local/lib/ruby/gems/2.2/gems/opal-0.8.0/opal", "/usr/local/lib/ruby/gems/2.2/gems/opal-0.8.0/stdlib", "/usr/local/lib/ruby/gems/2
.2/gems/opal-0.8.0/lib", "/home/jeremy/code/roda-opal-example/assets/js"]

Note that if you don't clear your browser cache, it may work in non-compiled mode as Roda will use a 304 response instead of rendering the asset, since the modified time of the asset file hasn't changed.

from roda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.