Open sunnyrjuneja opened 7 years ago
yea.. i'm having the same issue.. with multiple css.map files
This is still happening in Rails 6.rc1 and sprockets-rails 3.2.1.
I solved it for now by importing from @import "bootstrap/scss/bootstrap"
instead of @import "bootstrap/dist/css/bootstrap"
.
@dennyluan i did the same to get rid of the error
Hi, i'm having the same issue but with .min.js files
I require a file from node_modules
so
//= require bootstrap4-toggle/js/bootstrap4-toggle.min
but then when I open the devtools on Chrome, console shows an error
ActionController::RoutingError: No route matches [GET] "/assets/bootstrap4-toggle.min.js.map"
Any idea how can I solve this?
I also encountered a similar situation.
It may not be a fundamental solution, but I decided to use the sprockets processor to remove all sourceMappingURL in .css file.
The code looks like below.
require 'source_mapping_url_delete_processor'
Sprockets.register_preprocessor('text/css', SourceMappingUrlDeleteProcessor)
* lib/source_mapping_url_delete_processor.rb
module SourceMappingUrlDeleteExecutor def self.call(input)
data = input[:data]
if (data.lines.last =~ /^\/\*# sourceMappingURL=/)
data_lines_array = data.lines
data_lines_array.delete_at(-1)
data = data_lines_array.join
end
{ data: }
end end
- (version memo)
- sprockets-rails 3.4.2
- sprockets 4.0.3
- rails 7.0.4
Hi there,
I'm a very happy user of the aforementioned technologies and very grateful for the contributors. I've noticed a small issue that I was hoping to report when using Rails 5.1.4. One of my assets points to a sourcemap and I'm having problems telling Rails where to look for it. Since Rails doesn't know where to find it, it throws an error in the console :(.
Whenever I visit any page, I get
What's the best way to inform the asset pipeline of a sourcemap? The directory looks like...
The bottom of the CSS has:
My package.json looks like...
And my application.js...