Answers.Body: <p>I figured this one out, it was bad error handling on my part.</p>
  
  <p>If the service you're calling returns NULL, this will appear in the network tab as a 404.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-19T17:48:37.677Z
Answers.LastActivityDate: 2018-12-19T17:48:37.677Z
Answers.UserDisplayName: slander
Body: <p>I've created a module for a project that has several actions, all of which are called through AJAX. Each is a post request that sends over any required params plus the CSRF token using the method described here: <a href="https://craftcms.com/guides/enabling-csrf-protection#updating-your-javascript" rel="nofollow noreferrer">https://craftcms.com/guides/enabling-csrf-protection#updating-your-javascript</a></p>
  
  <p>On localhost, everything works correctly. On the staging server, some work correctly but others return a 404 error. Specifically, the response gives "Template not found: actions/module-name/location/geocode-inputs".</p>
  
  <p>web.log doesn't look to be throwing any errors, and I'm not sure where else to look. Any ideas on what might be going wrong?</p>
  
Tags: <controller><multi-environment><404><modules>
Title: Some (but not all) controller action routes return 404 on staging server
ThreadText: # Some (but not all) controller action routes return 404 on staging server
  
  (Asked by: username_0 on 2018-12-11)
  
  I've created a module for a project that has several actions, all of which are called through AJAX. Each is a post request that sends over any required params plus the CSRF token using the method described here: <https://craftcms.com/guides/enabling-csrf-protection#updating-your-javascript>
  
  On localhost, everything works correctly. On the staging server, some work correctly but others return a 404 error. Specifically, the response gives "Template not found: actions/module-name/location/geocode-inputs".
  
  web.log doesn't look to be throwing any errors, and I'm not sure where else to look. Any ideas on what might be going wrong?
  
  **Tags:** controller, multi-environment, 404, modules
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-12-19. Score: 2 | Accepted answer
  
  I figured this one out, it was bad error handling on my part.
  
  If the service you're calling returns NULL, this will appear in the network tab as a 404.
  
  
  ---
  
  