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

JavaScript subdependencies not reachable (importmap) #3

Open
t-hedeon opened this issue Feb 28, 2024 · 1 comment
Open

JavaScript subdependencies not reachable (importmap) #3

t-hedeon opened this issue Feb 28, 2024 · 1 comment

Comments

@t-hedeon
Copy link

t-hedeon commented Feb 28, 2024

Describe the bug
When i tried to use Tabs component it didn't work as it should (it's not interactive) and then i realized that i have a lot of errors in JS console about phlex_ui dependencies that comes from importmap

To Reproduce
Steps to reproduce the behavior:

  1. Install gems:
gem "phlex-rails", "~> 1.1"
gem "phlex_ui", "~> 0.1.6"
gem 'tailwindcss-rails', "~> 2.3"
bin/rails generate phlex:install
  1. Install JS part
bin/importmap pin phlex_ui

Import the package in your app/javascript/application.js file import 'phlex_ui'

  1. Install Styles as it described in the docs https://phlexui.com/docs/installation/rails_importmaps
  2. Copy/paste the Tabs code snippet https://phlexui.com/docs/tabs
  3. Build CSS rails tailwindcss:build
  4. On the page i can see styled tabs, but without content (because contents have .hidden class)

Expected behavior
Tabs should work as on the exaple

Screenshots
image

Desktop:

  • OS: macos (Apple silicon M1)
  • Browser chrome
  • Version 122.0.6261.69

Additional info:
Found similar issues - rails/importmap-rails#65, rails/importmap-rails#157

seems like it broken by new update rails/importmap-rails#230 (comment)

The solution that i found to set manually compiled CDN like

pin "date-fns", to: 'https://ga.jspm.io/npm:[email protected]/index.mjs'

instead of

pin "date-fns"
@t-hedeon t-hedeon changed the title JavaScript dependencies not reachable (importmap) JavaScript subdependencies not reachable (importmap) Feb 28, 2024
@SethHorsley
Copy link

SethHorsley commented Oct 15, 2024

thank you for looking into this, i am trying to add better support for importmaps in rbui and found another issue lol:
rails/importmap-rails#153
and this:
rails/importmap-rails#217

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

No branches or pull requests

2 participants