160 questions
0
votes
0
answers
114
views
Using omines:datatables-bundle with Symfony 7 and asset mapper
The documented way to use omnies:datatables-bundle does not seem compatible with asset mapper and importmap. Getting jQuery to wor k with asset mapper at all is a bit of a trick, and there doesn't ...
1
vote
0
answers
132
views
404 errors after using importmap with Rails 8
I have the following within my importmap.rb
pin 'core-js/stable', to: 'core-js--stable.js' # @3.42.0
However, when I try to import that package into my application.js:
import 'core-js/stable';
this ...
0
votes
0
answers
56
views
Resolving Javascript Modules with importmap not working on android chrome
I have a symfony project with the assetmapper package active. There is an app.js which imports:
import './styles/app.css';
import Wood from "./wood.js";
The gernerated importmap looks like ...
0
votes
2
answers
138
views
"Body size limit exceeded" error when installing FilePond via importmap:install in Symfony
I'm facing an issue when trying to install the FilePond library using Symfony's importmap system.
I attempted to add FilePond to my project by running php bin/console importmap:require filepond (or ...
2
votes
1
answer
398
views
Importing React using importmap not always loading
Basically I'm trying to load React from an external source using an import map (needed because multiple JS files use React). We have an issue where it loads when you first access the page, but if you ...
1
vote
2
answers
307
views
How to properly import a modular JS library in Rails using Importmap (case date-fns)?
In my Rails 8 app I'm using Importmap and I would like to use date-fns in an appropriate manner given only one functionality and a couple of locales from that JS library are needed. Below is what I ...
4
votes
2
answers
304
views
Can I use the importmap-rails gem to replace yarn or can I use it with yarn?
I'm having trouble using importmap-rails to manage npm packages. I would ideally like it to function like yarn where it keeps track of versions, dependencies and downloads everything for you with a ...
1
vote
0
answers
984
views
Import maps using React Vite
I'm trying to use import maps with React and Vite. I have a React Vite application called app1 with the following vite.config.ts:
import { defineConfig } from "vite";
import react from "...
0
votes
1
answer
203
views
Rails Importmap in Production Loading Incorrect JavaScript Files (MIME type “text/html”)
I’m using Rails 7 with importmaps to manage JavaScript modules. My app works fine in development, but in production, some JavaScript files are failing to load with the following error in the console:
...
0
votes
0
answers
86
views
Rails 7.1.3 - my javascript function is not found when invoking window.onload on page load
I have an application on Rails 7.1.3.4, upgraded from Rails 6. I am in the process of converting to using import maps for Javascript that the application uses. I am not using Turbo and Stimulus in ...
1
vote
0
answers
96
views
Ruby on Rails - Stimulus doesn't work with Slim-select & Tailwind (DigitalOcean App Platform)
I created an app that uses tailwind, stimulus and slim-select.
In development everything works fine, but in production my import maps break for some reason and the Asset Pipeline breaks for my ...
0
votes
1
answer
139
views
how to include import map in JavaScript debugging in Nodel.js?
I'm currently debugging a local Node.js solution and I was wondering, is it possible to add an importmap to Node.js so I can use Import with resource name?
My import map:
<script type="...
2
votes
1
answer
906
views
ActiveAdmin v4 how to add custom JS via importmaps
ActiveAdmin v4 supports importmaps.
How can I add custom JS to ActiveAdmin via importmaps?
E.g. https://github.com/ankane/chartkick as asked on GitHub
4
votes
2
answers
576
views
Langchain Deno Import Map cannot use common langchain/core
Using Supabase Langchain Edge Functions, I cannot seem to force resolve the same langchain/core package version using import_map scopes.
I'm trying to import:
langchain/
@langchain/core
@langchain/...
3
votes
1
answer
727
views
Importmap Rails and Stimulus when working with Rails Engines
I'm unable to get stimulus and importmaps to read files from an app engine. The current project I've been tasked to do involves me upgrading all legacy engines to use importmaps and stimulus JS. The ...
0
votes
1
answer
74
views
importmap raises "SyntaxError: Unexpected identifier" with interact.js
I'm trying to import interact.js with an importmap, but I get the error:
Uncaught SyntaxError: Unexpected identifier 'interactjs'.
My importmap:
<script type="importmap">
{
...
0
votes
0
answers
272
views
Stimulus and Turbo not loading on Rails 7 application with Importmaps
I'm currently moving out from webpacker to use importmaps and sprockets on Rails 7 but I can't get the config right and get these errors in console:
Uncaught TypeError: Failed to resolve module ...
1
vote
1
answer
124
views
stylesheet_link_tag with path, not only the file name
I am adding some extra CSS/JS files into my vendor folder:
vendor/my_theme/css/app.css
vendor/my_theme/css/bundle.css
vendor/my_theme/js/app.js
They belong to an external theme I am integrating. I ...
0
votes
0
answers
801
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="...
3
votes
1
answer
1k
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
497
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 "@...
1
vote
0
answers
450
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
375
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
474
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
86
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
147
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 ...
2
votes
0
answers
313
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
379
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
303
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
318
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
244
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 ...
2
votes
1
answer
784
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 ...
1
vote
1
answer
371
views
Importmap for Rails with JS Module Pattern Error: "net::ERR_ABORTED 404 (Not Found)"
I'm using Importmap for Rails 7 implementing the JavaScript Module Pattern and I'm getting errors related to loading of custom helpers JS files in the production environment.
My app/javascript has a ...
0
votes
1
answer
729
views
How to avoid caching on importmap.js in micro frontend (Single-spa) applications
2 micro frontends and root application deployed in S3 bucket through AWS cloudfront distribution.
in my s3 bucket files have stored in following structure
app1_281 (react micro frontend)
app2_13 (...
1
vote
1
answer
2k
views
Javscript using importmaps not working looking for modules under assets
I am trying to convert my rails 7 application using sprockets to use import maps because I was having issues using turbo and hotwire. I am not using bootstrap or tailwind. We are using materialize.
...
3
votes
1
answer
1k
views
How to use postcss-import with tailwindcss-rails and importmaps
I started a new rails project and am attempting to get tailwind running on it.
I'd like to be able to have the tailwind css files separated for organizational reasons.
Relevant gems in my Gemfile:
gem ...
2
votes
1
answer
204
views
Adding HighLightJS to rails 7.1 with ImportMaps
I'm trying to add HightlightJS
# importmap.rb
pin "highlightjs", to: "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"
// application.js
import ...
1
vote
0
answers
151
views
Use ts-select2 in Rails with importmap
I am trying to install ts-select2 in a Rails 7 App.
I ran:
./bin/importmap pin ts-select2
And it added this line to config/importmap.rb
pin "ts-select2", to: "https://ga.jspm.io/npm:ts-...
1
vote
1
answer
422
views
Rails engine importmap Uncaught ReferenceError: tinymce is not defined
I am using importmap with a downloaded version of tinymce in a rails 7.1 engine. I am failing to get the editor to display and the browser console shows the following error
Uncaught ReferenceError:...
1
vote
1
answer
4k
views
Import module from folder with deno
I have a npm module with a package.json at my folder ./module
When I import that in a file and run it with deno, it throws an error 'error: Is a directory (os error 21)'. Likely this is because my ...
1
vote
1
answer
265
views
Maplibre and Rails 7 importmaps
in config/importmap.rb:
pin "maplibre-gl", to: "https://ga.jspm.io/npm:[email protected]/dist/maplibre-gl.js"
However, trying to use this library: import * as maplibregl from &...
1
vote
1
answer
2k
views
importmap-rails + sprockets not finding stimulus-loading.js in fresh stimulus-rails installation
Mature app updating to Rails 7.0.7, Ruby 3.1.2, adding stimulus-rails using the installer, with importmap-rails, turbo-rails and sprockets-rails already installed. No custom Stimulus controllers yet, ...
-1
votes
1
answer
234
views
Rails 6.1 — add `importmap-rails`, gem bundles but methods unavailable
Ruby: 3.1.2, Rails 6.1
Trying to add gem importmap-rails to an existing Rails 6.1 app.
The gem bundles, but neither the rake importmap:install task nor the gem helper method <%= ...
1
vote
1
answer
1k
views
Upgrade Rails 6.1 > 7.0, add turbo-rails and importmap, gems do not install
I'm trying to upgrade a working legacy app to Rails 7, from Rails 6.1. I want to use Hotwire, so I added gem turbo-rails.
Ruby 3.1.2
zeitwerk
no webpacker
sprockets-rails
no modern JS yet
app passes ...
1
vote
1
answer
207
views
404 error when importing npm yaml package into Rails 7
I'm trying to import the yaml npm package into a Rails 7 app; but, I appear to be missing a step. When I attempt to load a page that imports this package, I get this 404:
Started GET "/_/...
0
votes
1
answer
157
views
How do I use workers with node_modules?
I have in my project folder:
index.html
src
resources
node_modules
index.html:
<!DOCTYPE html>
<html>
<head>
<title>WebGPU App</title>
<meta ...
2
votes
1
answer
715
views
Precompilation in rails 7
As in older versions of rails, in production, we used to precompile our assets first so that performance can be better while serving assets from public. But in rails 7, as default configuration says ...
1
vote
0
answers
269
views
Importmaps in rails 7
I am new to rails 7 and dont know where to put my custom js files.
Now I know the importmaps are used to get third part javascript libraries via cdn's and we include in our application.js file. But ...
0
votes
1
answer
2k
views
What happens when using "Import Map" in react-app? How does it avoid build systems?
"Import maps are a new way for web pages to control the behavior of JavaScript imports, potentially enabling you to ditch your build system."
I could not find any explanation of how it ...
1
vote
0
answers
478
views
Access to script at has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
I have an issue on all my servers and localhost by getting CORS error when getting js files from CDN.
It occurs today and nothing was changed in the codebase before. Yesterday everything works fine.
...