Closed Manipandian closed 1 year ago
@Manipandian Thanks for reporting this issue! I was able to confirm the inconsistency of build errors when running stencil build
if a src/components.d.ts
file does not exist or is not updated with the latest component metadata (props, events, etc.). I'll get this issue labeled and ingested into our backlog for the team to take a look at!
Thanks again and hope you're enjoying Stencil!
@tanner-reits , Thanks for immediate response. Is there any workaround to get through this issue?, For now every-time we are triggering stencil build two times to overcome this issue. But that will affect our build time, because of huge code base in long run.
Closing as a duplicate of #3534
This is still an issue the team will address. However, all future updates will be tracked in the linked issue.
Prerequisites
Stencil Version
3.2.1
Current Behavior
When i try to run "stencil build" command with some new type errors in component code, It is not reporting those errors and generating build successfully. But if i run the same command again, this time i can get that error. I thought it is happening, because first time we dont have component.d.ts. But with that file also i can able to reproduce the issue by creating new type error in component and triggering build command(If i trigger build second time without any change, i can get that error now). I have analysed component.d.ts, it is getting updated with new type details on first build itself.
Expected Behavior
While running Stencil Build command with type error on code, We should get type errors on first time itself.
System Info
Steps to Reproduce
Code Reproduction URL
https://github.com/ionic-team/stencil-component-starter
Additional Information
Note: I have analysed Stencil source code, You have some condition to check whether component.d.ts file got any changes after transpile or not. Whenever that condition return true, It is ignoring type validation error and proceeding with build generation(~/src/compiler/types/generate-app-types.ts). I found it through you debug log only(config.logger.debug(
generateAppTypes: ${componentsDtsRelFileName} has changed
))