Using the nextjs getStaticProps feature in my project has been smooth sailing so far. However, after uploading the Static files to IIS, the feature seemed to stop working until I configured a urlRewrite module on it.
I noticed that when initially visiting a page, getStaticProps is not fired until the entire page is refreshed. Below are the codes I used for the urlRewrite module:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReactRouter Routess" stopProcessing="true">
<match url="product\/(\d+)\/.*" />
<action type="Redirect" url="/product/{R:1}.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
If anyone knows why this is happening and how I can fix it, please let me know.