新的 Rails 7 应用程序带有 -j esbuild,JavaScript 似乎被“禁用”;

发布于 2025-01-19 16:26:28 字数 556 浏览 5 评论 0原文

I tried this exact approach to create a new Rails 7 app in How to install jQuery and bootstrap in rails 7 app using esbuild (without webpacker) , but now it seems like my rails app is just ignoring javascript all together - no errors, but no javascript running either (if I add a console log or alert, nothing happens, or introduce bugs in the existing js, no errors are reported - it’s as if the “JavaScript” folder doesn’t exist). I didn’t make any changes to the default created app. If I try creating a new app without esbuild, then I do have javascript working (executing), but then of course i have the issue I was originally trying to solve with esbuild of getting jquery to work. Any thoughts please on what I could be missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三人与歌 2025-01-26 16:26:28

哇 - 必须有些东西。我仍在使用Rails Server而不是./bin/dev-使该开关修复了。

Wow - it had to be something. I was still using rails server instead of ./bin/dev - making that switch fixed it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文