cypress-esbuild-preprocessor
cypress-esbuild-preprocessor copied to clipboard
In watch mode, if there is a compile error, Cypress is not notified (fix included!)
If the compilation actually fails in watch mode, Cypress just carries on using the last compiled file, which is incredibly confusing ("why aren't my changes coming through"). What is supposed to happen is it goes to the error state.
The reason this is happening is the errors
array is never checked and a rejected promise is never returned.
Cypress docs state:
The callback function should return one of the following:
- A promise* that eventually resolves the path to the built file**.
- A promise* that eventually rejects with an error that occurred during processing.
There's a few other fixes needed where I know the solution. Especially around how its not using the promises correctly to track when the file has truly been written.
However, going to see if this PR is merged first before making the effort as unsure if this is monitored. I'm happy to help maintain this :).