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

Adding load path #373

Closed
chlebta opened this issue Aug 30, 2016 · 2 comments
Closed

Adding load path #373

chlebta opened this issue Aug 30, 2016 · 2 comments

Comments

@chlebta
Copy link

chlebta commented Aug 30, 2016

Expected behavior

In my application.js I'm trying to add /= require file that exist in different directory then javascript folder

Actual behavior

I get always

Sprockets::FileNotFound at /
couldn't find file 'datatables/dataTables.bootstrap' with type 'application/javascript'

System configuration

  • Sprockets version : 3.6.2
  • Sprockets-rails version : 3.0.4
  • Ruby version : 2.3.0
  • Rails version : 5.0.0.rc1

Example App

This is my application.js :
//= require datatables/dataTables.bootstrap

This is my config.ru :

# This file is used by Rack-based servers to start the application.

require_relative 'config/environment'

require 'sprockets'
map '/assets' do
  environment = Sprockets::Environment.new
  environment.append_path 'vendor/plugins/adminlte/plugins'
  run environment
end

map '/' do
  run Rails.application
end

# run Rails.application

And this is the link of folder I'm trying to add :

https://github.com/80percent/adminlte-rails/tree/master/vendor/assets/plugins/adminlte/plugins

@gilesbowkett
Copy link

I believe this is a non-issue.

@chlebta I created an example app here based on your description:

https://github.com/gilesbowkett/sprockets-373-example

I couldn't figure out your meaning when you said "the link of the folder I'm trying to add." definitely go ahead and fork my example and send a PR if you want to clarify that.

however, I think you won't need to.

the readme for AdminLTE, the gem you're trying to use, says that this line:

= require datatables/dataTables.bootstrap

goes in the application.css file. But your description above says that you put it in the application.js file.

So, although I was unable to reproduce your error in my example app, I think you may have just put a CSS require inside a JS file.

@schneems
Copy link
Member

schneems commented Sep 6, 2016

I made this PR but never got it over the line #322 would show you all the load paths when you get an error.

Is this still an issue? Did you get it working?

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

3 participants