Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preprocessor errors are hidden #5

Closed
angryziber opened this issue May 18, 2020 · 5 comments
Closed

Preprocessor errors are hidden #5

angryziber opened this issue May 18, 2020 · 5 comments

Comments

@angryziber
Copy link

angryziber commented May 18, 2020

Why call preprocessor in a separate process?
If it fails, the standard error remains invisible, stdout returns an empty string and svelte compiler produces an empty component, which just doesn't work and very hard to understand why

@angryziber
Copy link
Author

I see that most likely subprocess is used for a hacked 'deasync' of svelte.preprocess() call...
Isn't there a better way supported by jest?

Anyway, I would suggest adding '--unhandled-rejections=strict' to child node.

And FYI: the problem I was debugging ended up being a problem with node installed with snap package in Ubuntu: https://github.com/nodejs/node/issues/33456

So this approach can have undesired side-problems that are really hard to debug...

@mihar-22
Copy link
Collaborator

Hey @angryziber, ye I know it's a shitty hack to make it work but async transformations are currently not supported by Jest. When I was building this transformer I tried a bunch of different approaches but they all had some cost, and this was the most stable work around I could get going.

The good news is that async transformations are being worked on now (jestjs/jest#9889) but seems to be still a little early to tell when it'll be done.

Thanks for the suggestion on --unhandled-rejections=strict, I'll add it in.

@mihar-22
Copy link
Collaborator

Okay done it's released in 1.0.6, and I'll immediately switch over to async transforms once they're ready.

@angryziber
Copy link
Author

@mihar-22 thanks

@mikebridge
Copy link

I was getting the error node: bad option: --unhandled-rejections=strict, so I'll note it here in case anyone is googling that message.

Node 10.16.3 is still pretty widespread---this flag was only introduced recently in 10.17.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants