I've created a small content three with two pages. Every page have the jcr:primaryType set to "kcs:Page" (a custom type that I've registered into repository).
Under the "/apps/kcs/Page" i've created some HTL scripts, so now I expect that if I request the page with my browser the scripts are executed using the resource type set in the primaryType of the node; but it doesn't work.
I've got a Null pointer exception (see stack trace as attachment) that I've find it is caused by the missing of the "sling:resourceType" property.
Trying with the sling:resourceType property set in the resource, the page works correctly. Analyzing the issue more in depth I found that the problem is related to the presence of some "data-sly-include" inside the HTL code that if the "sling:resourceType" is missing it doesn't work.