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

[Bug]: resolve error printed as debug message #2033

Closed
Boshen opened this issue Aug 21, 2024 · 1 comment · Fixed by #2076
Closed

[Bug]: resolve error printed as debug message #2033

Boshen opened this issue Aug 21, 2024 · 1 comment · Fixed by #2076
Assignees
Labels
bug Something isn't working good first issue Good for newcomers needs-triage

Comments

@Boshen
Copy link
Member

Boshen commented Aug 21, 2024

Reproduction link or steps

I'm testing Rolldown in https://github.com/oxc-project/monitor-oxc/tree/rolldown

pnpm install
pnpm run rolldown

It's currently producing debug error message for resolve errors. The process also hangs.

What is expected?

Nicer error messages. No hang.

What is actually happening?

let resolved_err = anyhow::format_err!(
"Unexpectedly failed to resolve dependencies of {importer}. Got errors {build_errors:#?}",
importer = self.resolved_id.id,
);

 ERROR  Rolldown internal error: Unexpectedly failed to resolve dependencies of /Users/boshen/oxc/monitor-oxc/node_modules/.pnpm/eslint-plugin-import@2.29.1_@typescript-eslint+parser@8.2.0_eslint@9.9.0_jiti@1.21.6_supports_zmswtkamuftpl7jgsbtw22axge/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js. Got errors [
    (
        RawImportRecord {
            module_request: Rstr(
                "eslint/lib/cli-engine/file-enumerator",
            ),
            kind: Require,
            namespace_ref: SymbolRef {
                owner: 1606,
                symbol: SymbolId(
                    311,
                ),
            },
            module_request_start: 1710,
            meta: ImportRecordMeta(
                0x0,
            ),
        },
        PackagePathNotExported(
            "./lib/cli-engine/file-enumerator",
            "/Users/boshen/oxc/monitor-oxc/node_modules/.pnpm/eslint-plugin-import@2.29.1_@typescript-eslint+parser@8.2.0_eslint@9.9.0_jiti@1.21.6_supports_zmswtkamuftpl7jgsbtw22axge/node_modules/eslint/package.json",
        ),
    ),

System Info

None

Any additional comments?

No response

@shulaoda
Copy link
Contributor

I will try to improve this diagnostic and investigate whether it can be aligned with rollup or esbuild.

github-merge-queue bot pushed a commit that referenced this issue Aug 22, 2024
<!-- Thank you for contributing! -->

### Description
1. Part of #2033 
<!-- Please insert your description here and provide especially info
about the "what" this PR is solving -->
github-merge-queue bot pushed a commit that referenced this issue Aug 22, 2024
…s` (#2036)

<!-- Thank you for contributing! -->

### Description
1. try #2033  you will receive 

![image](https://github.com/user-attachments/assets/f85f4bce-f9eb-489c-8b22-9e800106313c)
This is because when there is a none recoverable error occurred in
`fetch_all_modules`, the function will directly return

https://github.com/rolldown/rolldown/blob/8e0cb613e4dd50b5f70a4a648ad72d243b80a432/crates/rolldown/src/module_loader/module_loader.rs#L286-L288
Then all the pending task will fail to send `Msg` since the channel is
closed.
Then the `expect` will trigger a panic, 

https://github.com/rolldown/rolldown/blob/8e0cb613e4dd50b5f70a4a648ad72d243b80a432/crates/rolldown/src/module_loader/module_task.rs#L60-L62
2. This pr will wait for all tasks to be finished when meets a
`Msg::Panic`
<!-- Please insert your description here and provide especially info
about the "what" this PR is solving -->
github-merge-queue bot pushed a commit that referenced this issue Aug 28, 2024
<!-- Thank you for contributing! -->

### Description
closes #2033 

<img width="814" alt="image"
src="https://github.com/user-attachments/assets/7358884a-1283-434a-a4de-c2a5b1a1f810">

<!-- Please insert your description here and provide especially info
about the "what" this PR is solving -->
github-merge-queue bot pushed a commit that referenced this issue Aug 28, 2024
<!-- Thank you for contributing! -->

### Description
1. follow up of #2033
<!-- Please insert your description here and provide especially info
about the "what" this PR is solving -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers needs-triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants