简体   繁体   中英

application.js file showing up as application.html.erb when sent to client

After running a cap deploy, I'm getting an error when navigating to my site on the client:

Uncaught SyntaxError: Unexpected token '<' application-[hash here].js line 1

When I look at the file "application.js" on the client, it simply shows me a rendered version of my application.html.erb. The first line of that file is naturally <!DOCTYPE html> so it makes sense that it would get that error at line 1. But why would html be getting sent over in place of my javascript? I ran this same deploy several times earlier today and it worked fine.

I understand there are all sorts of variables here that could be causing this issue, but I guess what I'm looking for are just thoughts on what could possibly be causing the issue.

Any thoughts?

If anyone who happens to run into this error in the future, it turned out that the issue I was having was actually with my nginx.conf file. Had nothing to do with rails.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM