'No route matches [GET] "/assets/application.js & No route matches [GET] "/assets/application.css

I am moving away from Webpack to Esbuild, using jsbundling-rails and cssbundling-rails.

Rails version is 6.1.5

Everything seems to be working fine, but in my logs I get:

ActionController::RoutingError (No route matches [GET] "/assets/application.js-71bd51ca6859614cd46b64034f1484dfa019cb295ac852a804b8c30fc2f9ba0b.map"):

ActionController::RoutingError (No route matches [GET] "/assets/application.css-3b0754679fcb32c2b76c56e443ad8651a084344d65ce5995fe745125487fbda9.map"):

I can't work out what process is still looking for files at these locations.

package.json

{
  "name": "****",
  "private": true,
  "dependencies": {
    "@paypal/paypal-js": "^1.0.2",
    "@popperjs/core": "^2.11.5",
    "@rails/ujs": "^7.0.2-4",
    "bootstrap": "^5.1.3",
    "drift-zoom": "^1.4.3",
    "dropzone": "^5.9.3",
    "esbuild": "^0.14.38",
    "eslint": "^8.11.0",
    "foundation-sites": "^6.7.4",
    "jquery": "^3.6.0",
    "lazysizes": "^5.3.2",
    "motion-ui": "^2.0.3",
    "node-sass": "^7.0.0",
    "nodelist-foreach-polyfill": "^1.2.0",
    "objectFitPolyfill": "^2.3.0",
    "postcss": "8.x",
    "prismjs": "^1.27.0",
    "promise-polyfill": "^8.1.3",
    "sass": "^1.51.0",
    "select2": "^4.0.8",
    "serialize-javascript": "5.0.1",
    "slick-slider": "^1.8.2",
    "sortablejs": "^1.10.2",
    "svg-sprite-loader": "^6.0.11",
    "svg4everybody": "^2.1.9",
    "svgo": "^1.3.0",
    "svgo-loader": "^2.2.1",
    "what-input": "^5.2.10",
    "whatwg-fetch": "^3.0.0",
    "yargs-parser": "18.1.2"
  },
  "devDependencies": {
    "autoprefixer": "^9.5.0",
    "cssnano": "^4.1.10",
    "postcss-import": "^12.0.1",
    "postcss-loader": "^3.0.0",
    "sugarss": "^2.0.0"
  },
  "scripts": {
    "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds",
    "build:css": "sass ./app/assets/stylesheets/application.sass.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules"
  }
}

Tags in my layout

 <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
 <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>


Solution 1:[1]

The problem was that I still had my public/packs folder from when I was using webpack. I removed this and the missing file errors went.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pseudo-Hippy