Questions tagged [import-maps]
Import maps allow control over the resolution of bare import specifiers (e.g., import x from "x"). They define what URLs get fetched by JavaScript import statements and import() expressions.
import-maps
146
questions
0
votes
0
answers
80
views
Symfony 7.1 fresh install with asset mapper / stimulus bundle gives "@hotwired/stimulus was a bare specifier" when rendering page
I am installing a new Symfony 7.1 / PHP 8.3.8 app with asset mapper and stimulus bundle and I am encountering issues with making stimulus functional :
symfony new my_project_directory --version="...
1
vote
1
answer
57
views
Rails 7 with Import Maps and CSS Bundling: Assets Not Served from /builds Directory
Rails 7 with Import Maps and CSS Bundling: Assets Not Served from /builds Directory
I'm working on a Rails 7 application where I'm using Import Maps for JavaScript and CSS Bundling via Yarn instead of ...
1
vote
2
answers
77
views
error trying to import module pinned in import map
I have a rails 7 app and I'm trying to add hotwire functionality. I am getting an error with pinning stimulus and importing it in application.js
importmap.rb
pin "application"
pin "@...
0
votes
0
answers
56
views
javascript_importmap_tags is creating a link to "application.js" with error
I am working on adding javascript handling to a rails 7 app. I want to use import maps to import external libraries for turbo and stimulus. The current issue I'm having trouble with is that ...
1
vote
1
answer
97
views
JS file is blocked due to bad MIME in production
In my Rails 7 project I have been using importmap for importing JS modules. here is the config:
# config/importmap
pin "application", preload: true
pin "@hotwired/turbo-rails", to:...
0
votes
1
answer
80
views
Use environment variable inside importmap - single-spa
I'm trying to use a environment variable inside the importmap that is used for single-spa configuration:
<% if (isLocal) { %>
<script type="systemjs-importmap">
{
&...
0
votes
1
answer
42
views
Heroku router error ActionController::RoutingError (No route matches [GET] "/assets/modules/seat_builder.js")
The error that I am getting, in the Heroku server logs is this:
ActionController::RoutingError (No route matches [GET] "/assets/modules/seat_builder.js")
This error is popping up for every ...
0
votes
1
answer
55
views
Lightbox2 navigation images missing when using importmap
In a rails 7.1 project I'm using importmap to load lightbox2
importmap.rb
pin "lightbox2", to: "https://ga.jspm.io/npm:[email protected]/dist/js/lightbox.js"
This works but none of ...
0
votes
0
answers
147
views
Toastr rails using importmaps in rails 7
I am having trouble displaying my toast messages in rails using importmaps default setup. This is my code.
This is my layout file
<!DOCTYPE html>
<html>
<head>
<title>...
2
votes
0
answers
105
views
Uncaught TypeError: The specifier alpinejs was a bare specifier, but was not remapped to anything. Relative module specifiers must start with ./,
I am using Ruby on Rails with Import map but I got this error on Firefox 115 / Windows 8.1.
Dev console error
Uncaught TypeError: The specifier alpinejs was a bare specifier, but was not remapped to ...
-1
votes
1
answer
90
views
One Stimulus controller not loading after migrating Rails 7 app to importmaps
I am trying to move away from yarn, npm and webpacker to importmaps. I clearly did a lot of things right cause some of my JavaScript is loading. Some of my Stimulus controllers are not being ...
2
votes
0
answers
145
views
Import powerbi-client-vue-js.umd.js with importmap leads to Uncaught TypeError: Cannot read properties of null (reading 'defineComponent')
below follows the code sample that should work out-of-the-box by Microsoft documentation: https://github.com/microsoft/powerbi-client-vue-js
I would like to integrate the module powerbi-client-vue-js ...
1
vote
1
answer
194
views
Lightbox2 with Rails 7.1 not initialising
I'm trying to use the javascript library Lightbox2 with a rails 7.1 application.
config/importmap.rb:
pin "jquery", to: "https://ga.jspm.io/npm:[email protected]/dist/jquery.js"
pin &...
0
votes
0
answers
110
views
Making Prism JS to work in Rails 7 with Import Maps
I would like to use Prism in my Rails 7 project to highlight code in specific pages.
To make that:
I downloaded the Development version of Prism for Markup + HTML + ..., CSS, C-like, and JavaScript ...
1
vote
1
answer
387
views
Rails 7.1.2 + StimulusJS: Issue with Stimulus controller action after triggering a custom event on window
I am working on a Rails 7.1.2 application with Ruby 3.2.2 and facing an intermittent problem with Google Maps loading. The map sometimes loads in Firefox, but rarely in Brave. There seems to be an ...