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

Source maps aren't working #157

Closed
relappi opened this issue Nov 12, 2015 · 32 comments
Closed

Source maps aren't working #157

relappi opened this issue Nov 12, 2015 · 32 comments

Comments

@relappi
Copy link

relappi commented Nov 12, 2015

Source maps don't appear to be working when creating a new edge rails app.

Creating a new rails app, adding a basic / empty controller, action, view, and then adding a simple coffeescript file with a debugger statement in it yields this in the chrome inspector...

ss-1

Digging into the application.js file shows that the source mapping url is there, but the map doesn't seem to be served...

ss-2

Example app: https://github.com/relappi/source-maps-testapp

@cannikin
Copy link

cannikin commented Dec 9, 2015

Any updates on this one? It makes debugging JS and CSS in the web inspector next to impossible when you can't get any help finding the offending code in your own source files.

@jeremy
Copy link
Member

jeremy commented Dec 9, 2015

Still broken, @cannikin. Nobody's on board to investigate, much less fix it. Please do dig in 😁

@cannikin
Copy link

cannikin commented Dec 9, 2015

Ohhhh boy! But we're definitely sticking with the source map idea rather than the current (Rails 3/4) behavior of including all JS and CSS files separately while in development?

@jeremy
Copy link
Member

jeremy commented Dec 9, 2015

Nothing definitive. Reverting to the current behavior is a good option until sourcemap support works as people expect.

@schneems
Copy link
Member

schneems commented Dec 9, 2015

Source maps are on my radar, but i'm playing catchup. See: #124 (comment) for a rundown of where we are right now. Source maps are a pretty big project, it's not like it was done and just has a few edge cases that need polishing. I'm trying to get official time at work to dedicate to source maps, and haven't made much progress there.

@cannikin
Copy link

cannikin commented Dec 9, 2015

Is it an "easy" matter to revert to the current behavior (individual includes) so in the meantime people running on edge can use the web inspector? Then re-enable source maps in master once they're working properly?

Is a release candidate for Rails 5 being talked about at all? If this can't get fixed by that date then it'll have to get reverted, no?

@schneems
Copy link
Member

schneems commented Dec 9, 2015

There's no release of sprockets 4 so there's nothing to revert. Master branch is a WIP. I would recommend using Sprockets 3.

@cannikin
Copy link

cannikin commented Dec 9, 2015

Oh damn, that worked! I assumed edge rails required edge sass-rails, which requires edge sprockets. Gemfile now looks like:

gem 'rails', github: 'rails/rails'
gem 'arel',  github: 'rails/arel'
gem 'rack',  github: 'rack/rack'

gem 'sprockets-rails'
gem 'sass-rails'

Thanks!

@schneems
Copy link
Member

schneems commented Dec 9, 2015

🚀

@schneems
Copy link
Member

I tested this app out with my branch #206. Cleared tmp/cache and I'm getting all the correct files generated. I tried adding a CSS file and it doesn't show up, there seems to be a problem in the directive processor source maps.

@schneems
Copy link
Member

Strike that, needed to clear the cache again and it worked. I'm worried that there is so much cache clearing needed. Looks like my branch works? Can you give it a try on your app and report back?

@rafaelfranca
Copy link
Member

I think you can automatically clear the cache of you bump the version of
the preprocessors.

On Tue, Dec 29, 2015, 19:03 Richard Schneeman notifications@github.com
wrote:

Strike that, needed to clear the cache again and it worked. I'm worried
that there is so much cache clearing needed. Looks like my branch works?
Can you give it a try on your app and report back?


Reply to this email directly or view it on GitHub
#157 (comment).

@schneems
Copy link
Member

I added a file to a running sprockets process

$ echo "body { color: black; }" > app/assets/stylesheets/foo.css

When I refreshed the page, the change was in application.css but the source map didn't change. I would have expected that a change in the dependencies of application.css would have forced a new source map compile, maybe it was browser caching though? Restarting and clearing tmp/cache fixed.

@schneems
Copy link
Member

schneems commented Jan 7, 2016

I've got no known blockers for source maps. What do you think next steps should be? Merge that branch, cut a pre-release and get people trying it?

@rafaelfranca
Copy link
Member

Seems like a great plan 👍

@vincentwoo
Copy link

@schneems seconded, would love to begin hammering source maps for bugs :)

@modosc
Copy link
Contributor

modosc commented Feb 9, 2016

@schneems

I added a file to a running sprockets process

$ echo "body { color: black; }" > app/assets/stylesheets/foo.css

When I refreshed the page, the change was in application.css but the source map didn't change. I would have expected that a change in the dependencies of application.css would have forced a new source map compile, maybe it was browser caching though? Restarting and clearing tmp/cache fixed.

in chrome this has been the case for some time - you have to explicitly close and reopen developer tools to get fresh source maps. it looks like they just started to fix it:

https://code.google.com/p/chromium/issues/detail?id=508270

@modosc
Copy link
Contributor

modosc commented Feb 25, 2016

i've been trying to get this to work locally. in debug mode it does but when i do things in production mode (ie compile: false, compress / precompile) no source maps are written to the file system. i found a few specific issues:

  1. i managed to get source maps created by modifying UglifierCompresser#call to add a link to the sourcemap:
def call(input) 
  js, map = @uglifier.compile_with_map(input[:data])
  map = SourceMapUtils.combine_source_maps(
    input[:metadata][:map],
    SourceMapUtils.decode_json_source_map(map)["mappings"]
  )
  # add link to the source map
  links = Set.new(input[:metadata][:links])
  map_uri = input[:environment].build_asset_uri(input[:filename], { type: "application/js-sourcemap+json" })
  links << map_uri
  { data: js, map: map, links: links }

i could do this for the other compressors that generate source maps as well - is that the right approach or should this be a separate processor that runs after all compressors and conditionally adds the links if necessary?

  1. i haven't figured out how to get SourceMapCommentProcessor to work in this setup - it seems like it needs the compressed asset and sourcemap to already exist before it can process them and i can't figure out where in the pipeline this could work. am i missing something obvious here?

  2. the naming scheme is pretty weird:

application-ef55b783ca58249584af04454c3633ff39e4675b1ec688041ffd8b201c392755.js
application-ef55b783ca58249584af04454c3633ff39e4675b1ec688041ffd8b201c392755.js.gz
application.js-5ff0dcfc81e4a820f599282a1f7191a77f32e796ccc119a552959ff305ee4604.map
application.js-5ff0dcfc81e4a820f599282a1f7191a77f32e796ccc119a552959ff305ee4604.map.gz
application.source-a03afb9430f54c35f78d8a65aaeefcc9f7de0a69024761462a3a314d84679a66.js

should digest_path be fixed so that i end up with something like this instead?

application-ef55b783ca58249584af04454c3633ff39e4675b1ec688041ffd8b201c392755.js
application-ef55b783ca58249584af04454c3633ff39e4675b1ec688041ffd8b201c392755.js.gz
application-5ff0dcfc81e4a820f599282a1f7191a77f32e796ccc119a552959ff305ee4604.js.map
application-5ff0dcfc81e4a820f599282a1f7191a77f32e796ccc119a552959ff305ee4604.js.map.gz
application-a03afb9430f54c35f78d8a65aaeefcc9f7de0a69024761462a3a314d84679a66.source.js

@vincentwoo
Copy link

@schneems ping! Would love to know if you've had the time to work on sprockets recently, and source maps more specifically.

@rafaelfranca
Copy link
Member

@vincentwoo have you tried the sprockets 4 betas?

@vincentwoo
Copy link

When trying to use the latest betas of sprockets (I also had to use 6.0.0.beta1 for sass-rails, too), I get the following error when my view tries to render and image_tag:

NoMethodError - undefined method `call' for SourceURL:Class
Did you mean?  caller:
  sprockets (4.0.0.beta2) lib/sprockets/processor_utils.rb:83:in `call_processor'
  sprockets (4.0.0.beta2) lib/sprockets/processor_utils.rb:65:in `block in call_processors'
  sprockets (4.0.0.beta2) lib/sprockets/processor_utils.rb:64:in `call_processors'
  sprockets (4.0.0.beta2) lib/sprockets/loader.rb:147:in `load_from_unloaded'
  sprockets (4.0.0.beta2) lib/sprockets/loader.rb:58:in `block in load'
  sprockets (4.0.0.beta2) lib/sprockets/loader.rb:323:in `fetch_asset_from_dependency_cache'
  sprockets (4.0.0.beta2) lib/sprockets/loader.rb:42:in `load'
  sprockets (4.0.0.beta2) lib/sprockets/cached_environment.rb:20:in `block in initialize'
  sprockets (4.0.0.beta2) lib/sprockets/cached_environment.rb:47:in `load'
  sprockets (4.0.0.beta2) lib/sprockets/bundle.rb:23:in `block in call'
  sprockets (4.0.0.beta2) lib/sprockets/utils.rb:152:in `dfs'
  sprockets (4.0.0.beta2) lib/sprockets/bundle.rb:24:in `call'
  sprockets (4.0.0.beta2) lib/sprockets/processor_utils.rb:83:in `call_processor'
  sprockets (4.0.0.beta2) lib/sprockets/processor_utils.rb:65:in `block in call_processors'
  sprockets (4.0.0.beta2) lib/sprockets/processor_utils.rb:64:in `call_processors'
  sprockets (4.0.0.beta2) lib/sprockets/loader.rb:147:in `load_from_unloaded'
  sprockets (4.0.0.beta2) lib/sprockets/loader.rb:58:in `block in load'
  sprockets (4.0.0.beta2) lib/sprockets/loader.rb:323:in `fetch_asset_from_dependency_cache'
  sprockets (4.0.0.beta2) lib/sprockets/loader.rb:42:in `load'
  sprockets (4.0.0.beta2) lib/sprockets/cached_environment.rb:20:in `block in initialize'
  sprockets (4.0.0.beta2) lib/sprockets/cached_environment.rb:47:in `load'
  sprockets (4.0.0.beta2) lib/sprockets/base.rb:66:in `find_asset'
  sprockets (4.0.0.beta2) lib/sprockets/base.rb:73:in `find_all_linked_assets'
  sprockets (4.0.0.beta2) lib/sprockets/manifest.rb:124:in `block in find'
  sprockets (4.0.0.beta2) lib/sprockets/manifest.rb:123:in `find'
  sprockets-rails (3.0.4) lib/sprockets/railtie.rb:49:in `precompiled_assets'
  sprockets-rails (3.0.4) lib/sprockets/railtie.rb:34:in `asset_precompiled?'
  sprockets-rails (3.0.4) lib/sprockets/railtie.rb:214:in `block (3 levels) in <class:Railtie>'
  sprockets-rails (3.0.4) lib/sprockets/rails/helper.rb:345:in `precompiled?'
  sprockets-rails (3.0.4) lib/sprockets/rails/helper.rb:349:in `raise_unless_precompiled_asset'
  sprockets-rails (3.0.4) lib/sprockets/rails/helper.rb:323:in `digest_path'
  sprockets-rails (3.0.4) lib/sprockets/rails/helper.rb:311:in `asset_path'
  sprockets-rails (3.0.4) lib/sprockets/rails/helper.rb:89:in `block in resolve_asset_path'
  sprockets-rails (3.0.4) lib/sprockets/rails/helper.rb:229:in `block in resolve_asset'
  sprockets-rails (3.0.4) lib/sprockets/rails/helper.rb:228:in `resolve_asset'
  sprockets-rails (3.0.4) lib/sprockets/rails/helper.rb:88:in `resolve_asset_path'
  sprockets-rails (3.0.4) lib/sprockets/rails/helper.rb:78:in `compute_asset_path'
  actionview (4.2.6) lib/action_view/helpers/asset_url_helper.rb:135:in `asset_path'
  actionview (4.2.6) lib/action_view/helpers/asset_url_helper.rb:292:in `image_path'
  actionview (4.2.6) lib/action_view/helpers/asset_tag_helper.rb:211:in `image_tag'
  app/views/home/index.html.erb:18:in `_app_views_home_index_html_erb__3040277196995776486_70252122942280'
  actionview (4.2.6) lib/action_view/template.rb:145:in `block in render'
  activesupport (4.2.6) lib/active_support/notifications.rb:166:in `instrument'
  actionview (4.2.6) lib/action_view/template.rb:333:in `instrument'
  actionview (4.2.6) lib/action_view/template.rb:143:in `render'
  rack-mini-profiler (0.9.9.2) lib/mini_profiler/profiling_methods.rb:76:in `block in profile_method'
  actionview (4.2.6) lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
  actionview (4.2.6) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
  activesupport (4.2.6) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (4.2.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.2.6) lib/active_support/notifications.rb:164:in `instrument'
  actionview (4.2.6) lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
  actionview (4.2.6) lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
  actionview (4.2.6) lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
  actionview (4.2.6) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
  actionview (4.2.6) lib/action_view/renderer/template_renderer.rb:14:in `render'
  actionview (4.2.6) lib/action_view/renderer/renderer.rb:46:in `render_template'
  actionview (4.2.6) lib/action_view/renderer/renderer.rb:27:in `render'
  actionview (4.2.6) lib/action_view/rendering.rb:100:in `_render_template'
  actionpack (4.2.6) lib/action_controller/metal/streaming.rb:217:in `_render_template'
  actionview (4.2.6) lib/action_view/rendering.rb:83:in `render_to_body'
  actionpack (4.2.6) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
  actionpack (4.2.6) lib/action_controller/metal/renderers.rb:37:in `render_to_body'
  actionpack (4.2.6) lib/abstract_controller/rendering.rb:25:in `render'
  actionpack (4.2.6) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
  activesupport (4.2.6) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
  /opt/rubies/ruby-2.3.0/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
  activesupport (4.2.6) lib/active_support/core_ext/benchmark.rb:12:in `ms'
  actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
  actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
  activerecord (4.2.6) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
  actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:43:in `render'
  remotipart (1.2.1) lib/remotipart/render_overrides.rb:14:in `render_with_remotipart'
  actionpack (4.2.6) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
  actionpack (4.2.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.2.6) lib/abstract_controller/base.rb:198:in `process_action'
  actionpack (4.2.6) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.2.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (4.2.6) lib/active_support/callbacks.rb:117:in `call'
  activesupport (4.2.6) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
  activesupport (4.2.6) lib/active_support/callbacks.rb:505:in `call'
  activesupport (4.2.6) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
  activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
  activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.2.6) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (4.2.6) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (4.2.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.2.6) lib/active_support/notifications.rb:164:in `instrument'
  actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.2.6) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.2.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.2.6) lib/abstract_controller/base.rb:137:in `process'
  actionview (4.2.6) lib/action_view/rendering.rb:30:in `process'
  rack-mini-profiler (0.9.9.2) lib/mini_profiler/profiling_methods.rb:76:in `block in profile_method'
  actionpack (4.2.6) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.2.6) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.2.6) lib/action_controller/metal.rb:237:in `block in action'
  actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
  actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:43:in `serve'
  actionpack (4.2.6) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve'
  actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call'
  rack-pjax (0.8.0) lib/rack/pjax.rb:12:in `call'
  warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.6) lib/warden/manager.rb:34:in `call'
  rack (1.6.4) lib/rack/etag.rb:24:in `call'
  rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
  rack (1.6.4) lib/rack/head.rb:13:in `call'
  remotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'
  rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  activerecord (4.2.6) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
  activerecord (4.2.6) lib/active_record/migration.rb:377:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
  activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
  activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.6) lib/rails/rack/logger.rb:22:in `call'
  quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
  actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
  font_assets (0.1.12) lib/font_assets/middleware.rb:29:in `call'
  rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  rack-mini-profiler (0.9.9.2) lib/mini_profiler/profiler.rb:167:in `call'
  railties (4.2.6) lib/rails/engine.rb:518:in `call'
  railties (4.2.6) lib/rails/application.rb:165:in `call'
  railties (4.2.6) lib/rails/railtie.rb:194:in `method_missing'
  puma (3.2.0) lib/puma/configuration.rb:227:in `call'
  puma (3.2.0) lib/puma/server.rb:561:in `handle_request'
  puma (3.2.0) lib/puma/server.rb:406:in `process_client'
  puma (3.2.0) lib/puma/server.rb:271:in `block in run'
  puma (3.2.0) lib/puma/thread_pool.rb:111:in `block in spawn_thread'

@schneems
Copy link
Member

schneems commented Apr 4, 2016

the naming scheme is pretty weird:

This is because sprockets can't split the file name any better. I tried to change this, but it was too expensive. Maybe it's possible but I gave up.

I'm not a big fan of how sprockets uses URIs to store all data about an asset and then parses that URI, it seems slow but I haven't had any time to look into implementing an alternative. It's also so baked into everything I don't think there's a viable way forward, we're pretty stuck with what we've got.

would love to know if you've had the time to work on sprockets recently, and source maps more specifically.

I've got Sprockets 4 beta working with codetriage.com and source maps. Unfortunately my general knowledge is still pretty limited here, the best way forwards to resolving specific problems is to open new issues and to attach example apps that repro the problems.

@drewhamlett
Copy link

drewhamlett commented Jul 6, 2016

Source maps working fine in development for me. Couldn't get production to generate maps. I then tried @modosc method with

      # add link to the source map
      links = Set.new(input[:metadata][:links])
      map_uri = input[:environment].build_asset_uri(
        input[:filename],
        type: 'application/js-sourcemap+json'
      )
      links << map_uri
      { data: js, map: map, links: links }

That generates the maps but doesn't like the application.js to them. So kind of stuck now. The hash name doesn't follow the actual naming of the file otherwise I would just add it manually.

@schneems
Copy link
Member

If you have example apps that show source maps not working correctly can you open separate tickets and link example apps?

@ibrahima
Copy link

ibrahima commented Aug 18, 2016

I don't know if this is relevant, but I was just trying Sprockets 4 beta 2 with Rails 4. I set up a manifest.js and my app appears to work, and while I can access http://localhost:3000/assets/application.js.map , my actual application.js does not have a sourceMappingUrl comment anywhere. Is there something I need to do to enable it in Rails 4? Unfortunately I can't link the source because it's for work but I just waneted to make sure I wasn't missing something. Thanks for working on this!

Edit: Seems like I was able to get it to kind of work by adding an explicit

//# sourceMappingURL=/assets/application.js.map

to my application.js. Looking at SourceMapCommentProcessor, it seems like it doesn't get run automatically except in debug mode, but even in debug mode it didn't seem to work for me.

But the line numbers seem to be off still... not sure what's going on there yet. Will try to reproduce and submit an example app if I can!

@schneems
Copy link
Member

You shouldn't have to manually add a source map comment. It should just work "TM".

Please, if you have example apps that show source maps not working correctly open separate tickets and link an example app.

@danshultz
Copy link

@ibrahima I am also experiencing the line numbers being off. They are currently off by 2 lines exactly across the entire source. I'm working on trying to identify why this is but thought I would ping you to see if you happened to identify anything around this.

@schneems
Copy link
Member

Please try out master, it has a few new fixes. Otherwise if anyone comes across source maps not working please open up a new issue. I need to be able to gauge how stable master is. I want to work on releasing an RC and eventually 4.0.0 we can't do that without pretty decent source map support. I appreciate all your feedback, you've all helped tremendously. Please give it another go with master and let me know if you've got more issues (by opening a new issue).

@vincentwoo
Copy link

@schneems, it's super hard to test master because i have no idea which gems need to be updated. is there a guide on how to take a rails 4.2 project to master sprockets without everything mysteriously exploding? ill try to make a repro case but its hard to tell where to even start

@schneems
Copy link
Member

If you're already running the beta (you have to to get source maps, it's pretty easy to upgrade, put this in your gemfile and bundle install:

gem "sprockets", github: "rails/sprockets"

Master is only a few commits ahead of the 4.0 beta

@danshultz
Copy link

@vincentwoo - as a note, if you find your sourcemaps off by a few lines, I would check #388

@vincentwoo
Copy link

@danshultz i'm finding that with some files in my bundle the source maps appear to not even be able to find the correct file. i'll file a separate issue

drorp24 added a commit to drorp24/cambiu that referenced this issue Oct 22, 2016
#157 no source maps
upgrading to master should supposedly fix source maps

rails/sprockets#157
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

10 participants