Skip to content

Remove stale importmap pin for nonexistent app/javascript/uploading.js#153

Merged
capotej merged 1 commit into
capotej:mainfrom
EnriqueCanals:fix/remove-stale-uploading-importmap-pin
May 23, 2026
Merged

Remove stale importmap pin for nonexistent app/javascript/uploading.js#153
capotej merged 1 commit into
capotej:mainfrom
EnriqueCanals:fix/remove-stale-uploading-importmap-pin

Conversation

@EnriqueCanals
Copy link
Copy Markdown
Contributor

Summary

config/importmap.rb pins "app/javascript/uploading", but the file app/javascript/uploading.js has never existed in this repository (the pin was added in the initial commit and has been an orphan ever since). The result is a noisy warning on every page render that loads the importmap, e.g. on the post / page edit forms:

Importmap skipped missing path: app/javascript/uploading.js
Importmap skipped missing path: app/javascript/uploading.js
Importmap skipped missing path: app/javascript/uploading.js

The Stimulus controller that actually powers data-controller="uploading" on the markdown_excerpt / markdown_body textareas lives at app/javascript/controllers/uploading_controller.js and is auto-registered through the existing infrastructure:

# config/importmap.rb
pin_all_from "app/javascript/controllers", under: "controllers"
// app/javascript/controllers/index.js
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
eagerLoadControllersFrom("controllers", application)

So the stray pin is dead weight — removing it silences the warning and changes nothing about upload behavior.

Why this is safe

  • git log --diff-filter=A --name-only -- app/javascript/uploading.js returns nothing on main — the file has never existed.
  • The actual Stimulus controller at app/javascript/controllers/uploading_controller.js is unaffected and continues to register as uploading via Stimulus' auto-loader.
  • Active Storage's @rails/activestorage is still pinned (the line right above).

Test plan

  • On a working tree, render /blog/new and /p/about after the change — no Importmap skipped lines in log/development.log.
  • Markdown editor textareas (form.textarea ..., data: { controller: "uploading" }) still attach the Stimulus controller — drag-and-drop / paste-upload behavior unchanged.
  • Production blog (https://enriquecanals.com) running this exact change continues to handle uploads correctly.

Made with Cursor

The pin `"app/javascript/uploading"` has been in config/importmap.rb since
the first commit, but the file `app/javascript/uploading.js` has never
existed in the repository. The Stimulus controller that actually powers
`data-controller="uploading"` on the post / page edit forms lives at
`app/javascript/controllers/uploading_controller.js` and is auto-registered
via the existing `pin_all_from "app/javascript/controllers"` line combined
with `eagerLoadControllersFrom("controllers", application)` in
`app/javascript/controllers/index.js`.

The result of the stray pin is a noisy warning on every page render that
loads the importmap:

    Importmap skipped missing path: app/javascript/uploading.js

Removing the dead pin silences the warning. The upload controller continues
to load and function exactly as before (verified locally: post edit form
renders without warnings and Stimulus still attaches the uploading
controller to the markdown_body / markdown_excerpt textareas).

Co-authored-by: Cursor <cursoragent@cursor.com>
@capotej capotej merged commit 289e300 into capotej:main May 23, 2026
4 checks passed
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