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

Add webpacker gem and install #380

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add webpacker gem and install #380

wants to merge 1 commit into from

Conversation

gbp
Copy link
Member

@gbp gbp commented Mar 1, 2021

@gbp gbp force-pushed the webpacker branch 2 times, most recently from 62ff092 to d19453f Compare March 1, 2021 12:49
@gbp
Copy link
Member Author

gbp commented Mar 1, 2021

This is working on staging. JS went from 393.6 KB to 166.9 KB

@gbp gbp changed the base branch from develop to master March 25, 2021 09:44
@garethrees
Copy link
Member

Currently failing to build because of mime issue:

    default:  * spring (2.1.1)
    default:  * spring-watcher-listen (2.0.1)
    default:  * web-console (4.1.0)
    default:  * webpacker (6.0.0.beta.5)
    default: Install missing gems with `bundle install`
    default: Fetching gem metadata from https://rubygems.org/
    default: .
    default: .
    default: .
    default: .
    default: .
    default: .
    default: .
    default: .
    default: .
    default: Your bundle is locked to mimemagic (0.3.5), but that version could not be found
    default: in any of the sources listed in your Gemfile. If you haven't changed sources,
    default: that means the author of mimemagic (0.3.5) has removed it. You'll need to update
    default: your bundle to a version other than mimemagic (0.3.5) that hasn't been removed
    default: in order to install.
    default:
    default: == Command ["bundle install"] failed ==
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

@gbp
Copy link
Member Author

gbp commented Mar 29, 2021

@garethrees Rails has been bumped and this branch has been rebased

@gbp gbp requested a review from garethrees March 29, 2021 11:39
@garethrees
Copy link
Member

    default: Installing webpacker 6.0.0.beta.5
    default: Fetching govuk_elements_form_builder 1.3.1
    default: Installing govuk_elements_form_builder 1.3.1
    default: Bundle complete! 31 Gemfile dependencies, 132 gems now installed.
    default: Bundled gems are installed into `/home/vagrant/.bundle`
    default: Post-install message from sass:
    default:
    default: Ruby Sass has reached end-of-life and should no longer be used.
    default:
    default: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new
    default:   primary implementation: https://sass-lang.com/install
    default:
    default: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the
    default:   sassc gem: https://github.com/sass/sassc-ruby#readme
    default:
    default: * For more details, please refer to the Sass blog:
    default:   https://sass-lang.com/blog/posts/7828841
    default: yarn install v1.22.5
    default: [1/4] Resolving packages...
    default: warning webpack-dev-server > [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
    default: warning webpack-dev-server > chokidar > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
    default: warning webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
    default: warning webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
    default: [2/4] Fetching packages...
    default: error @rails/[email protected]: The engine "node" is incompatible with this module. Expected version ">=10.22.1 || ^12 || >=14". Got "8.10.0"
    default: error Found incompatible module.
    default: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
    default:
    default: == Command ["bin/yarn"] failed ==
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

@garethrees
Copy link
Member

When bumping the node version it installs okay.

diff --git a/script/provision-vagrant.sh b/script/provision-vagrant.sh
index ea59086..b22ee90 100644
--- a/script/provision-vagrant.sh
+++ b/script/provision-vagrant.sh
@@ -44,7 +44,7 @@ if [ ! -d "$HOME/.rbenv/versions/$RUBY_VERSION" ]; then
   bundle config path "$HOME/.bundle"
 fi
 
-export NODE_VERSION='8.10.0'
+export NODE_VERSION='14.16.0'
 if [ ! -d "$HOME/.nvm/versions/node/v$NODE_VERSION" ]; then
   echo 'Installing node and yarn'
   nvm install $NODE_VERSION

The app boots with shoreman, but then we get a 500 error.

Completed 500 Internal Server Error in 213ms (ActiveRecord: 0.0ms | Allocations: 7820)



ActionView::Template::Error (Webpacker can't find application.css in /home/vagrant/app/public/packs/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile to true for your environment
   unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
Your manifest contains:
{
}
):
    1: <% content_for :head do %>
    2:   <%= csrf_meta_tags %>
    3:   <%= csp_meta_tag %>
    4:   <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    5:   <!--[if lte IE 9]>
    6:     <%= javascript_pack_tag 'application-ie9', async: true, 'data-turbolinks-track': 'reload' %>
    7:   <![endif]-->

app/views/layouts/application.html.erb:4
app/views/layouts/application.html.erb:1

I'm assuming 3 or 4 is the issue here.

In the case of 4, well, it looks like we don't have a manifest.

3 could also be an issue. I note config/webpacker.yml has some port definitions. Perhaps they need to be reflected in the Vagrantfile?

@gbp
Copy link
Member Author

gbp commented Apr 23, 2021

@garethrees garethrees removed their request for review March 1, 2023 16:49
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

Successfully merging this pull request may close these issues.

2 participants