Repository navigation
Conversation
Workers inherit the parent's execArgv, including --input-type, which decides how eval workers run. A worker's file entry point has no parent URL, so it hit the ERR_INPUT_TYPE_NOT_ALLOWED check meant for the main entry point. Only apply that check on the main thread. Signed-off-by: Daniel Roe <daniel@roe.dev>
Collaborator
|
Review requested:
|
--input-type
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #68001 +/- ##
==========================================
- Coverage 92.97% 90.57% -2.41%
==========================================
Files 432 802 +370
Lines 201316 287005 +85689
Branches 30713 55429 +24716
==========================================
+ Hits 187172 259943 +72771
- Misses 13817 17156 +3339
- Partials 327 9906 +9579
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
currently, a process started with
--input-typecan't start a worker from a file.example
the issue is that the worker inherits
--input-typefrom the parent's exec arguments. that's useful for eval workers (since #54979), so I haven't dropped it, but instead just limited the check/error to the main thread's entry.Note
I'm ignoring an explicit
new Worker(file, { execArgv: ['--input-type=module'] }), just likenode --input-type=module file.cjson the main thread, but ... let me know if you think that's wrong.related: unjs/env-runner#115