这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(ecmascript): collect recoverable error after parse #7073

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

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

kwonoj
Copy link
Contributor

@kwonoj kwonoj commented Jan 22, 2024

Description

Turbopack in next.js does not report parse errors for the input like

function xyz() {
...

which expects to report

Expected '}', got '<eof>'

Comparing upstream swc, the only difference is turbopack collect recoveable error eagerly before actual parsing, and then parse returns a parsed program. (ref: https://github.com/swc-project/swc/blob/979061f6babbbf855027b13eb574c5f3f7e24727/crates/swc_compiler_base/src/lib.rs#L62-L77)

PR fixes ordering of error collection as same as swc does.

Confirmed next.js with this change now reports expected error. (Note: doesn't mean tests are actually fixed, the output is not matching with snapshot still)

Closes PACK-2274

Copy link

vercel bot commented Jan 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
rust-docs ❌ Failed (Inspect) Jan 22, 2024 11:14pm
turbo-site ✅ Ready (Inspect) Visit Preview Jan 22, 2024 11:14pm
9 Ignored Deployments
Name Status Preview Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Jan 22, 2024 11:14pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Jan 22, 2024 11:14pm
examples-gatsby-web ⬜️ Ignored (Inspect) Jan 22, 2024 11:14pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Jan 22, 2024 11:14pm
examples-native-web ⬜️ Ignored (Inspect) Jan 22, 2024 11:14pm
examples-nonmonorepo ⬜️ Ignored (Inspect) Jan 22, 2024 11:14pm
examples-svelte-web ⬜️ Ignored (Inspect) Jan 22, 2024 11:14pm
examples-tailwind-web ⬜️ Ignored (Inspect) Jan 22, 2024 11:14pm
examples-vite-web ⬜️ Ignored (Inspect) Jan 22, 2024 11:14pm

Copy link
Contributor

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

✅ This change can build next-swc

Copy link
Contributor

github-actions bot commented Jan 22, 2024

🟢 CI successful 🟢

Thanks

@kwonoj kwonoj merged commit bdc40cb into main Jan 22, 2024
@kwonoj kwonoj deleted the fix-collect-recoverable-parse-err branch January 22, 2024 23:51
timneutkens added a commit to vercel/next.js that referenced this pull request Jan 23, 2024
* vercel/turborepo#7067 <!-- Tobias Koppers - fix a
hanging issue with strongly consistent reads -->
* vercel/turborepo#7068 <!-- Tobias Koppers - add
lazy_remove_children feature flag -->
* vercel/turborepo#7073 <!-- OJ Kwon -
fix(ecmascript): collect recoverable error after parse -->

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…epo#7073)

### Description

Turbopack in next.js does not report parse errors for the input like 

```
function xyz() {
...
```

which expects to report 
```
Expected '}', got '<eof>'
```

Comparing upstream swc, the only difference is turbopack collect
recoveable error eagerly _before_ actual parsing, and then parse returns
a parsed program. (ref:
https://github.com/swc-project/swc/blob/979061f6babbbf855027b13eb574c5f3f7e24727/crates/swc_compiler_base/src/lib.rs#L62-L77)

PR fixes ordering of error collection as same as swc does. 

Confirmed next.js with this change now reports expected error. (Note:
doesn't mean tests are actually fixed, the output is not matching with
snapshot still)


Closes PACK-2274
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…epo#7073)

### Description

Turbopack in next.js does not report parse errors for the input like 

```
function xyz() {
...
```

which expects to report 
```
Expected '}', got '<eof>'
```

Comparing upstream swc, the only difference is turbopack collect
recoveable error eagerly _before_ actual parsing, and then parse returns
a parsed program. (ref:
https://github.com/swc-project/swc/blob/979061f6babbbf855027b13eb574c5f3f7e24727/crates/swc_compiler_base/src/lib.rs#L62-L77)

PR fixes ordering of error collection as same as swc does. 

Confirmed next.js with this change now reports expected error. (Note:
doesn't mean tests are actually fixed, the output is not matching with
snapshot still)


Closes PACK-2274
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…epo#7073)

### Description

Turbopack in next.js does not report parse errors for the input like 

```
function xyz() {
...
```

which expects to report 
```
Expected '}', got '<eof>'
```

Comparing upstream swc, the only difference is turbopack collect
recoveable error eagerly _before_ actual parsing, and then parse returns
a parsed program. (ref:
https://github.com/swc-project/swc/blob/979061f6babbbf855027b13eb574c5f3f7e24727/crates/swc_compiler_base/src/lib.rs#L62-L77)

PR fixes ordering of error collection as same as swc does. 

Confirmed next.js with this change now reports expected error. (Note:
doesn't mean tests are actually fixed, the output is not matching with
snapshot still)


Closes PACK-2274
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…epo#7073)

### Description

Turbopack in next.js does not report parse errors for the input like 

```
function xyz() {
...
```

which expects to report 
```
Expected '}', got '<eof>'
```

Comparing upstream swc, the only difference is turbopack collect
recoveable error eagerly _before_ actual parsing, and then parse returns
a parsed program. (ref:
https://github.com/swc-project/swc/blob/979061f6babbbf855027b13eb574c5f3f7e24727/crates/swc_compiler_base/src/lib.rs#L62-L77)

PR fixes ordering of error collection as same as swc does. 

Confirmed next.js with this change now reports expected error. (Note:
doesn't mean tests are actually fixed, the output is not matching with
snapshot still)


Closes PACK-2274
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

Successfully merging this pull request may close these issues.

2 participants