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

wefit_admin.js:1 Uncaught Error: Sprockets::FileNotFound: couldn't find file 'foundation' with type 'application/javascript' #212

Closed
duyetpt opened this issue Dec 9, 2016 · 1 comment

Comments

@duyetpt
Copy link

duyetpt commented Dec 9, 2016

When I add the gem in my engine, gemspecs as follow

 s.add_dependency "rails", "~> 5.0.0", ">= 5.0.0.1"

  s.add_dependency 'haml'
  s.add_dependency 'haml-rails'
  s.add_dependency 'sass-rails'
  s.add_dependency 'uglifier', '>= 1.3.0'
  s.add_dependency 'jquery-rails'
  s.add_dependency 'foundation-rails'

my_engine.js as follow

//= require jquery
//= require jquery_ujs
//= require foundation
//= require_tree .

$(document).foundation();

I setup engine.rb as follow

initializer 'WefitAdmin precompile hook', group: :all do |app|
      root_foundation_gem = Gem.loaded_specs['foundation-rails'].full_gem_path
      Dir.glob("#{root_foundation_gem}/**/").each do |path|
        app.config.assets.paths << path
      end

      app.config.assets.precompile += %w(my_engine/my_engine.css my_engine/my_engine.js)
    end

When i run with development mode, my site can load css file, but cause error when load js file.
I check foundation gem directory and see foundation.js.es6. So i think maybe the file is not precompiled.

@mrkrlli
Copy link

mrkrlli commented Feb 22, 2017

Facing a similar issue here

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