Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

v4: ActiveAdmin 4.0.0.beta15 not working on Firefox 138.0.1 due to import map issues#8724

Unanswered
durcak asked this question inHelp
Discussion options

🐞 ActiveAdmin 4.0.0.beta15 not working on Firefox 138.0.1 due to import map issues


✅ Expected behavior

Basic UI interactions in ActiveAdmin should work in all modern browsers, including Firefox. Specifically:

  • Clicking“Add new” inhas_many nested forms should dynamically add a new input block.
  • Clicking thedelete link in index tables (e.g. to destroy a resource) should trigger the delete confirmation and perform the request.

These interactions should work without JavaScript errors in the browser console.


❌ Actual behavior

OnFirefox 138.0.1, the following interactions do not work:

  • The"Add new" link inhas_many fields does nothing.
  • Thedelete link in resource index tables does not trigger any action or confirmation.

The browser console reports:

Import maps are not allowed after a module load or preload has started. Uncaught TypeError: The specifier “active_admin” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./“, “../” or “/”.

This makes ActiveAdmin unusable in Firefox out of the box when both Vite and Importmap are present.


🧪 How to reproduce

  1. Useactiveadmin (4.0.0.beta15) in a Rails app withimportmap-rails andvite_rails.
  2. In yourapp/views/active_admin/_html_head.html.erb, include the following:
<metaname="viewport"content="width=device-width,initial-scale=1"><%=csrf_meta_tags%><%=csp_meta_tag%><%# On page load or when changing themes, best to add inline in `head` to avoid FOUC%><%= javascript_tag nonce: true do%>  if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {    document.documentElement.classList.add('dark')  } else {    document.documentElement.classList.remove('dark')  }<% end%><%= javascript_importmap_tags "active_admin", importmap: ActiveAdmin.importmap%><%= vite_typescript_tag 'active_admin'%>
  1. Open any ActiveAdmin form with has_many fields in Firefox 138.0.1.
  2. Click “Add new” or the delete link.
  3. Observe that nothing happens.
  4. Check the browser console for the above-mentioned error.

💻 System configuration
•activeadmin (4.0.0.beta15)
•Firefox version: 138.0.1
•Using both importmap-rails and vite_rails
•Rails 8.0.2

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Hello, is this a generic compatibility issue between importmap and vite?

You must be logged in to vote
1 reply
@durcak
Comment options

Hi! Thanks for the reply.
I’m not sure if this is a generic compatibility issue between importmap and Vite.

In my case, I’m removing importmap completely and migrating the whole application to Vite (using vite_rails).

My goal is to have ActiveAdmin fully integrated in the Vite pipeline — including JS, SCSS (with Tailwind), and custom components.

I’ve managed to get most of it working, but I’m running into some issues when trying to load @activeadmin/activeadmin SCSS styles via Vite. It seems to fail due to how the SCSS is structured internally (e.g., using@import, which Vite/Sass warns about or fails to resolve).

Is there any known or recommended way to use ActiveAdmin 4 fully within a Vite-based setup?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Help
Labels
None yet
2 participants
@durcak@tagliala
Converted from issue

This discussion was converted from issue #8723 on May 13, 2025 14:33.


[8]ページ先頭

©2009-2025 Movatter.jp