Comments (9)
The xray-rails gem is supposed to automatically inject its JavaScript file into the response. It does this with a middleware that parses the response, finds where jQuery is being included, and inserts its JavaScript after that.
This process is automatic and solves the deployment issues you mentioned, but it the parse+insert step is a bit brittle. If your jQuery isn't in a file called "jquery", for example, that may be the problem. Or you might have found a bug.
Maybe you could paste the HTML source of your app's <head>
that gets sent to the browser and we can figure out why xray-rails is failing to find jQuery and perform the insertion of its own JS.
from xray-rails.
I'm actually using jQuery2, so maybe that's the problem?
<script src="/assets/jquery2.self-a4777c1acac0a74340755725342901a54ed000955bf6f5320491b8b2514c86ec.js?body=1"></script>
<script src="/assets/jquery_ujs.self-d456baa54c1fa6be2ec3711f0a72ddf7a5b2f34a6b4f515f33767d6207b7d4b3.js?body=1"></script>
<script src="/assets/jquery.countdown.min.self-7438de4717ee05bd2b2f56a30b1d4ff0bc562b031fd81fa80253457e8f761da1.js?body=1"></script>
<script src="/assets/jquery.singlePageNav.min.self-ea7214737c231c2754a39e74273816eda7a80f80dd4277402cb93c2cbd3646b8.js?body=1"></script>
<script src="/assets/jquery.superslides.min.self-0b5e8d70f7de04e5d1ed2a3410f03d73e5758a8707e120c0aece5af80a05eff6.js?body=1"></script>
<script src="/assets/custom.self-1c9050b98e5c346281862204a740128f39a823a92fad41816610ff35123f454a.js?body=1"></script>
<script src="/assets/wow.min.self-0d561dc583d8790bbe0d603b2f35c0021c14803d47ad8439b743a4d799821d1d.js?body=1"></script>
<script src="/assets/d3.self-8689d534a532bc8db6847d6391ca254ba3955aa7fb9499442b0986738a066574.js?body=1"></script>
<script src="/assets/registration.self-85db92e3836c9b18e766b352296e8cafa64f0e1505c4e2f2911b7238eb16022a.js?body=1"></script>
<script `src="/assets/application.self-16c207b3ca1b52afcfc7f4b662487caf1bbe084a6656bb15f693ab9de2d11be7.js?body=1"></script>
Originally, after reading your comment, I thought it was that I'm including most of my javascripts outside of the head, at the end of my page, for performance reasons, but even after making this change it still isn't working, so I'm think it doesn't look for jQuery2.js?
from xray-rails.
Agreed, it probably is because xray-rails isn't looking for jQuery2.js.
from xray-rails.
Is this something you plan on adding? I can't be the only one using jQuery2, can I?
from xray-rails.
I'm sure the maintainers of the project would accept a PR if you're willing to submit one. I'm just a fellow user of xray-rails that is trying to help as best I can.
from xray-rails.
Ha, you were so helpful I assumed you were a maintainer. I'll get right on that, @mattbrictson
from xray-rails.
Fixed by #65
from xray-rails.
Ha, you were so helpful I assumed you were a maintainer.
I am now (as of this week). 😄
from xray-rails.
Ha, I just reread this issue and was getting really confused. Great news.
from xray-rails.
Related Issues (20)
- Allow it to work with strict Content Security Policy; add nonce to javascript_include_tag HOT 1
- Xray-rails is not working with Docker HOT 2
- Travis configuration does not test Sprockets 4 or current Ruby versions
- Test suite fails with Sprockets::Railtie::ManifestNeededError HOT 1
- Xray fails to inject itself when using jQuery in Webpacker HOT 1
- Release xray.js on npm
- Drop support for Ruby <=2.4 (and Rails 4?)
- Remove auto-adding after jquery.js script — Sprockets 4 (nor webpack-based javascript_pack_tag 'application') doesn't add a separate script tag for jquery HOT 2
- Rewrite to remove dependency on jQuery
- Support for view_component HOT 1
- xray-rails 0.3.2 and sprockets 4
- ActionView::Template::Error - undefined method `pathname' HOT 4
- Rewrite to use `annotate_rendered_view_with_filenames`
- How to make xray-rails work with rails 7 and ruby 3+ HOT 1
- Early return from partial causes undefined method `include?' for nil:NilClass HOT 1
- "Screenshot" and "See Xray in action" links in the README are not working HOT 1
- calling non-existent method 'pathname' HOT 3
- Open in rubymine HOT 2
- The shortcut doesnot work on chrome/firefox for me anymore. HOT 1
- Defer loading of Xray JS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xray-rails.