Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not work with opal 1.2.0 and opal-sprockets 1.01 (it use sprockets 4) #49

Open
zw963 opened this issue Aug 11, 2021 · 5 comments
Open

Comments

@zw963
Copy link

zw963 commented Aug 11, 2021

Following is a my forked version playground.

It works if use old original Gemfile.lock, but when i try to update to use newest opal-sprockets, it failed.

Following is back trace.

Sprockets::FileOutsidePaths: /home/zw963/Stocks/playground/app.html.erb (index alias of /home/zw963/Stocks/playground/app/index.html.erb) is no longer under a load path: /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/opal-1.2.0/opal, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/opal-1.2.0/stdlib, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/opal-1.2.0/lib, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/ast-2.4.2/lib, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/ast-2.4.2/lib, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/parser-3.0.2.0/lib, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/inesita-0.9.2/opal, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/opal-virtual-dom-0.6.1/opal, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/inesita-router-0.3.0/opal, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/opal-browser-0.2.0/opal, /home/zw963/.rvm/gems/ruby-2.7.2@playground/bundler/gems/paggio-6c336a219aa0/lib, /home/zw963/Stocks/playground/app, /home/zw963/Stocks/playground/app_dev, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/opal-1.2.0/opal, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/opal-1.2.0/stdlib, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/opal-1.2.0/lib, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/ast-2.4.2/lib, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/ast-2.4.2/lib, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/parser-3.0.2.0/lib, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/inesita-0.9.2/opal, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/opal-virtual-dom-0.6.1/opal, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/inesita-router-0.3.0/opal, /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/opal-browser-0.2.0/opal, /home/zw963/.rvm/gems/ruby-2.7.2@playground/bundler/gems/paggio-6c336a219aa0/lib
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/sprockets-4.0.2/lib/sprockets/loader.rb:156:in `load_from_unloaded'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/sprockets-4.0.2/lib/sprockets/loader.rb:59:in `block in load'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/sprockets-4.0.2/lib/sprockets/loader.rb:337:in `fetch_asset_from_dependency_cache'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/sprockets-4.0.2/lib/sprockets/loader.rb:43:in `load'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/sprockets-4.0.2/lib/sprockets/cached_environment.rb:44:in `load'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/sprockets-4.0.2/lib/sprockets/base.rb:81:in `find_asset'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/sprockets-4.0.2/lib/sprockets/environment.rb:31:in `find_asset'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/sprockets-4.0.2/lib/sprockets/server.rb:65:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-rewrite-1.5.1/lib/rack/rewrite.rb:24:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/static.rb:161:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/builder.rb:244:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/inesita-0.9.2/lib/inesita/server.rb:88:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/inesita-livereload-0.1.1/lib/inesita/live_reload.rb:17:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/lint.rb:50:in `_call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/lint.rb:38:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/show_exceptions.rb:23:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/common_logger.rb:38:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/content_length.rb:17:in `call'
        /home/zw963/.rvm/gems/ruby-2.7.2@playground/gems/rack-2.2.3/lib/rack/handler/webrick.rb:95:in `service'
        /home/public/Dropbox/common/ruby/lib/webrick/httpserver.rb:140:in `service'
        /home/public/Dropbox/common/ruby/lib/webrick/httpserver.rb:96:in `run'
        /home/public/Dropbox/common/ruby/lib/webrick/server.rb:310:in `block in start_thread'
127.0.0.1 - - [11/Aug/2021:21:00:47 +0800] "GET /__ASSETS__ HTTP/1.1" 500 80792 0.0154
@jugcoding
Copy link

I encountered the same problem

The current inesita template seems not to work well with latest sprockets, and if you revert to an old sprocket version you lose the possibility to use latest Opal version.

I've rewritten the on-site sample app by removing sprocket, and use instead a rake based approach to build everything

You can try it here : https://github.com/jugcoding/raked-inesita
(latest Opal, autorecompilation, and livereload included)

My alternative rake builder is here : https://github.com/jugcoding/opal-rake

Compilation becomes instant with rake.

@zw963
Copy link
Author

zw963 commented Nov 8, 2021

I encountered the same problem

The current inesita template seems not to work well with latest sprockets, and if you revert to an old sprocket version you lose the possibility to use latest Opal version.

I've rewritten the on-site sample app by removing sprocket, and use instead a rake based approach to build everything

You can try it here : https://github.com/jugcoding/raked-inesita (latest Opal, autorecompilation, and livereload included)

My alternative rake builder is here : https://github.com/jugcoding/opal-rake

Compilation becomes instant with rake.

Hi, your fork works for me, though, you need update .ruby-version, because 2.3.1 is too old. not works anymore.

@zw963
Copy link
Author

zw963 commented Nov 8, 2021

@jugcoding , BTW, after update to newest opal and opal-sprockets, still get same error if not use opal-rake.

current, opal-sprockets project is live maintained, could you please port some of your's fix to upstream?

@jugcoding
Copy link

It's the first time I wrote a Gem. So I forked opal-sprockets. But opal-rake is not related to sprockets, it's a completely different build system. Unfortunately, there is nothing to port upstream.

Are you sure you need sprockets? You can do the same things with opal-rake What sprockets functionality is missing for you in opal-rake ?

I don't know what is the purpose of this .ruby-version: may the best approach is to remove it from the repo ?

@zw963
Copy link
Author

zw963 commented Nov 8, 2021

Are you sure you need sprockets? You can do the same things with opal-rake What sprockets functionality is missing for you in opal-rake ?

What i means is inesita depend on opal-sprockets, anyway, i will try opal-rake later. thank you.

I don't know what is the purpose of this .ruby-version: may the best approach is to remove it from the repo ?

Yes, you can remove it, or, you should specify a ruby version which can working with your's gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants