Closed mnyon-grandkru closed 1 year ago
as far as i can understand the problem even though webpacker is installed public/packs/*.json files do not exist which is why i am getting the error when the page tries to load.
i can "fudge" it by creating a manifest.json fine and filling it with boiler plate code but then it looks for the other two .js files in public/packs and doesnt find them so the app runs but returns the error in the console and dropdowns dont work
Ah, let's also add the repo while we're at it (updated to point to Spudos)
further testing carried out......
i following the following steps to generate my app
rails 6.1.7.3 new appname
set up my root path in routes.rb
root 'home#index'
create my home_controller.rb and add
class HomeController < ApplicationController
end
then create a home folder in layouts and index.html.erb in there, adding some example text
rails s to run the server
go to localhost:3000
and i get the error
Webpacker can't find application.js in /Users/andypierce/Desktop/testy/public/packs/manifest.json. Possible causes:
webpack -w
or the webpack-dev-server.<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
i can get the app to run by creating the packs folder in public and making a manifest.json file and copying some boiler plate code in there but that is call other .js files that dont exist
i have tried installed yarn and webpacker but nothing seems to create the missing files
Conclusion - its something to do with how i am creating the app as its falling over at stage one by trying to call files in public/packs that dont exist
the repo of my app that doesnt work is [https://github.com/Spudos/chat]
hi @Spudos,
How was this resolved? Were you able to create a manifest.json that Rails accepts, or is this still a challenge?
Hi @Spudos
I was looking at your Gemfile and noticed that you don't have the sprockets-rails gem in the Gemfile. I'd try adding/installing that gem and see if that helps.
ok i will try that.
I think it is my environment that is messed up, probably from installing several versions of rails and not using gemsets to split it all up
@Spudos Could you benefit from a screencast on using rvm to separate environments and setup to start? Since we're not due to meet until next week, I figured this may help when you have some downtime over the next few days: https://www.youtube.com/watch?v=cQVb7fHFjSM
thanks i will watch that later
A new programmer is currently trying to get semantic-ui working with a Rails 6 and Ruby 3.2.2 app:
Error with empty manifest.json
Error message with filled in manifest.json
I've opened up a Rails 6.1.7.3 instance and will try to replicate.