Repository navigation
Re: https://github.com/OpenHistoricalMap/issues/issues/929, changes t…o ohm-website to allow it to work with map-styles as an npm module. - #269
Conversation
…to work with map-styles as an npm module.
Generated by 🚫 Danger |
…ap-styles module.
|
As noted in OpenHistoricalMap/map-styles#32 (comment), we will need to ultimately host separate, fully functional style JSON files for each of the styles we host (Historical, Railway, Woodblock, Japanese Scroll) so that those styles can be easily used by other consumers, knowing they are pulling from the canonical source on openhistoricalmap.org. |
danrademacher
left a comment
There was a problem hiding this comment.
As far as I can tell, this all seems fine based on reading the code. But when I try to run the code locally, I get a big ol' Rails error:
ohm-website-web-1 | Started GET "/" for 172.20.0.1 at 2025-02-11 01:43:39 +0000
ohm-website-web-1 | Processing by SiteController#index as HTML
ohm-website-web-1 | Rendering layout layouts/map.html.erb
ohm-website-web-1 | Rendering site/index.html.erb within layouts/map
ohm-website-web-1 | Rendered site/index.html.erb within layouts/map (Duration: 5.5ms | GC: 0.0ms)
ohm-website-web-1 | Rendered layout layouts/map.html.erb (Duration: 235.6ms | GC: 0.8ms)
ohm-website-web-1 | Completed 500 Internal Server Error in 488ms (ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 3.7ms)
ohm-website-web-1 |
ohm-website-web-1 |
ohm-website-web-1 |
ohm-website-web-1 | ActionView::Template::Error (couldn't find file 'map-styles/dist/ohm.styles' with type 'application/javascript'
ohm-website-web-1 | Checked in these paths:
ohm-website-web-1 | /app/app/assets/config
ohm-website-web-1 | /app/app/assets/favicons
ohm-website-web-1 | /app/app/assets/images
ohm-website-web-1 | /app/app/assets/javascripts
ohm-website-web-1 | /app/app/assets/opensearch
ohm-website-web-1 | /app/app/assets/stylesheets
ohm-website-web-1 | /app/vendor/assets/iD
ohm-website-web-1 | /app/vendor/assets/javascript
ohm-website-web-1 | /app/vendor/assets/jquery
ohm-website-web-1 | /app/vendor/assets/leaflet
ohm-website-web-1 | /app/vendor/assets/polyfill
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/teaspoon-1.4.0/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/teaspoon-1.4.0/app/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/doorkeeper-5.7.1/app/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/doorkeeper-5.7.1/vendor/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/i18n-js-3.9.2/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/bootstrap_form-5.4.0/app/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/jquery-rails-4.6.0/vendor/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/turbo-rails-2.0.11/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/actiontext-7.2.2/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/actiontext-7.2.2/app/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/actioncable-7.2.2/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/activestorage-7.2.2/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/actionview-7.2.2/app/assets/javascripts
ohm-website-web-1 | /app/config
ohm-website-web-1 | /app/node_modules
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/popper_js-2.11.8/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/bootstrap-5.3.3/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/bootstrap-5.3.3/assets/javascripts
ohm-website-web-1 | /app/test/javascripts
ohm-website-web-1 | /app/test/javascripts/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/teaspoon-mocha-2.3.3/lib/teaspoon/mocha/assets):
ohm-website-web-1 |
ohm-website-web-1 | Causes:
ohm-website-web-1 | Sprockets::FileNotFound (couldn't find file 'map-styles/dist/ohm.styles' with type 'application/javascript'
ohm-website-web-1 | Checked in these paths:
ohm-website-web-1 | /app/app/assets/config
ohm-website-web-1 | /app/app/assets/favicons
ohm-website-web-1 | /app/app/assets/images
ohm-website-web-1 | /app/app/assets/javascripts
ohm-website-web-1 | /app/app/assets/opensearch
ohm-website-web-1 | /app/app/assets/stylesheets
ohm-website-web-1 | /app/vendor/assets/iD
ohm-website-web-1 | /app/vendor/assets/javascript
ohm-website-web-1 | /app/vendor/assets/jquery
ohm-website-web-1 | /app/vendor/assets/leaflet
ohm-website-web-1 | /app/vendor/assets/polyfill
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/teaspoon-1.4.0/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/teaspoon-1.4.0/app/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/doorkeeper-5.7.1/app/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/doorkeeper-5.7.1/vendor/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/i18n-js-3.9.2/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/bootstrap_form-5.4.0/app/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/jquery-rails-4.6.0/vendor/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/turbo-rails-2.0.11/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/actiontext-7.2.2/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/actiontext-7.2.2/app/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/actioncable-7.2.2/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/activestorage-7.2.2/app/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/actionview-7.2.2/app/assets/javascripts
ohm-website-web-1 | /app/config
ohm-website-web-1 | /app/node_modules
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/popper_js-2.11.8/assets/javascripts
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/bootstrap-5.3.3/assets/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/bootstrap-5.3.3/assets/javascripts
ohm-website-web-1 | /app/test/javascripts
ohm-website-web-1 | /app/test/javascripts/stylesheets
ohm-website-web-1 | /var/lib/gems/3.1.0/gems/teaspoon-mocha-2.3.3/lib/teaspoon/mocha/assets)
ohm-website-web-1 | 1: <% content_for :head do %>
ohm-website-web-1 | 2: <%= javascript_include_tag "index" %>
ohm-website-web-1 | 3: <% end %>
ohm-website-web-1 | 4:
ohm-website-web-1 | 5: <% content_for(:body_class) { "map-layout" } %>
ohm-website-web-1 |
ohm-website-web-1 | app/views/layouts/map.html.erb:2
ohm-website-web-1 | app/views/layouts/map.html.erb:1
ohm-website-web-1 | config/initializers/compressed_requests.rb:27:in `call'
ohm-website-web-1 | config/initializers/cors.rb:9:in `call'this is specific to pages with the map on it. About, Copyright, other mapless pages work fine. Homepage, /history, /export all fail with the same error
|
Did you do a |
I just did my usual practice of switching to the branch/PR I want to test and running To confirm, I checked out Is there some additional step required to run |
|
Do you have an If the module's been installed then it's a bug. |
|
Tried this docker compose build --no-cache
docker compose upLookimg at the build log, I see this: => [ 2/11] RUN apt-get update && apt-get install --no-install-recommends -y build-essential curl default-jre 184.4s
=> [ 3/11] RUN npm install --global yarn 6.5s
=> [ 4/11] RUN mkdir -p /app 0.3s
=> [ 5/11] WORKDIR /app 0.0s
=> [ 6/11] ADD Gemfile Gemfile.lock /app/ 0.0s
=> [ 7/11] RUN gem update bundler 5.3s
=> [ 8/11] RUN bundle install 110.8s
=> [ 9/11] ADD package.json yarn.lock /app/ 0.0s
=> [10/11] ADD bin/yarn /app/bin/ 0.0s
=> [11/11] RUN bundle exec bin/yarn install 65.1s
=> exporting to image 30.5s
=> => exporting layers 30.5s
=> => writing image sha256:088c07a03746bf846374c2733da1d2a11c2af25f41b391a8dade6c99a7db2914 0.0s
=> => naming to docker.io/library/ohm-website-webSo it looks to me like I then opened a terminal on # yarn install
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @mapbox/[email protected]" has unmet peer dependency "mapbox-gl@>=0.32.1 <2.0.0".
[4/4] Building fresh packages...
Done in 26.32s.
# But I still get the same rails error on loading the homepage locally: |
|
Although my Mac showed the correct subdirectory ( I tried to error. I then tried Nothing yet for you to check out, @danrademacher, I am still documenting what I'm doing in case we need to cherry pick some of these steps later. |
This fixes a reported issue on Discord
…}, {fastly}, and {bytemark} in locale files
…nhistoricalmap/map-styles module
|
I just reran the Docker build and confirmed it all now builds without error. We do have some issue with the styles that's different than the green water we had before: I suspect this is a result of some reworking of vector tiles that @Rub21 did and then @tsinn styled, but I'm not 100% sure of that. Hopefully pushing the latest maps styles to NPM and pulling in here will resolve the issue. Good news is the build from scratch is confirmed working, no more yarn errors. |
|
@danrademacher we currently remove land layer from |
This is pending the merge of OpenHistoricalMap/ohm-website#269 and should be merge only after that change. Note that we will also have a redirect of `main/main.json` to `/historical/historical.json`, so this PR is really about showing what we want people to do, and there should be no downtime



This is a companion pull request to OpenHistoricalMap/map-styles#32.