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

Failing requests for "No route matches [GET] "/assets/routes.js.map" #277

Closed
supairish opened this issue Jun 3, 2021 · 8 comments
Closed

Comments

@supairish
Copy link

Hello!

I'm working on upgrading a bit older rails app to 6.1.x and after updating js-routes to the 2.X series I keep seeing failed requests in my logs for

Exception: ActionController::RoutingError: No route matches [GET] "/assets/routes.js.map"

Also, I'm using Sprockets with js-routes still.

As far as I can tell js-routes still works fine.

Is there a way to turn off these source map requests? (I'm assuming that's what that file is)

Cheers

@bogdan
Copy link
Collaborator

bogdan commented Jun 4, 2021

I am not sure how you setup your Js Route env. Can you specify which configuration method do you use?

It is odd that it is requested for routes file only... And even if it is, it is definetelly something required in production and something that should be generated by webpack or sprockets.

@supairish
Copy link
Author

I followed the VERSION_2_UPGRADE.md

JsRoutes.setup do |config|
  # config for "old" way after upgrade to JsRoutes 2.0+
  # see https://github.com/railsware/js-routes/blob/master/VERSION_2_UPGRADE.md
  #
  config.module_type = nil
  config.namespace = 'Routes'
end

Then deleted the Rails caches and reran the generator

rails tmp:clear
rails js:routes

@bogdan
Copy link
Collaborator

bogdan commented Jun 4, 2021

Where is [GET] "/assets/routes.js.map" request generated?

@supairish
Copy link
Author

I'm not sure I thought it was coming from within js-routes

Let me investigate further today and see if I can get you more info

I appreciate your time

@supairish
Copy link
Author

Sorry for slow response.
The only reference I can find to "routes.js.map" is at the bottom of the generated routes.js file

    Utils.namespace(Root, "Routes", result);
    if (null) {
        Utils.define_module(null, result);
    }
    return result;
})(this);
//# sourceMappingURL=routes.js.map                 <--- HERE

Then it appears chrome/firefox devtools fires off the request for this file which doesn't exist for me.

Is the generator rake task suppose to create this file when using Sprockets or is this assuming I'm using webpack?

Thx

@le0pard
Copy link
Member

le0pard commented Jun 8, 2021

@supairish source maps generated by js build systems, not by this library. You need check you webpack/sprokets/whatever, where it hide source maps

@bogdan bogdan closed this as completed in dbff231 Jun 9, 2021
@bogdan
Copy link
Collaborator

bogdan commented Jun 9, 2021

@supairish I've got where it is comming from. Can you check the current master's version and see if the error goes away?

@supairish
Copy link
Author

@bogdan Yep that got rid of the request/error for me.

Thanks! ✌️😁👍

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

3 participants