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]: 1.0.0-alpha.1 JavaScript parsing error: Expression expected #7049

Closed
escaton opened this issue Jul 4, 2024 · 3 comments · Fixed by #7071
Closed

[Bug]: 1.0.0-alpha.1 JavaScript parsing error: Expression expected #7049

escaton opened this issue Jul 4, 2024 · 3 comments · Fixed by #7071
Assignees
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@escaton
Copy link
Contributor

escaton commented Jul 4, 2024

System Info

System:
OS: macOS 14.2.1
CPU: (12) arm64 Apple M2 Pro
Memory: 5.50 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
Yarn: 4.1.0 - ~/.nvm/versions/node/v20.11.0/bin/yarn
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
Browsers:
Chrome: 126.0.6478.127
Safari: 17.2.1
npmPackages:
@rspack/cli: 1.0.0-alpha.1 => 1.0.0-alpha.1
@rspack/core: 1.0.0-alpha.1 => 1.0.0-alpha.1
@rspack/plugin-react-refresh: 1.0.0-alpha.1 => 1.0.0-alpha.1

Details

After updating from 1.0.0-alpha.0 to 1.0.0-alpha.1 got this error on production build:

ERROR in × JavaScript parsing error: Expression expected

 24522 │             ERRORS_SENT_COUNT++, // noop
 24523 │             ;(0,ErrorTracker_/* getErrorTracker */.K)().debug(Error('***'));
       ·             ─

here is the related piece of source:

				if (ERRORS_SENT_COUNT++ < 3) {
					// noop
				}

				getErrorTracker().debug(new Error('***'))

The comma appears regardless of what is under the condition. It seems like the problem is the increment operator. I got 3 errors like this and in all cases, there is an increment in the condition.

git bisect pointed to this PR @ahabhgk FYI

Reproduce link

No response

Reproduce Steps

Run production build with rspack

@escaton escaton added bug Something isn't working pending triage The issue/PR is currently untouched. labels Jul 4, 2024
@markmssd
Copy link

markmssd commented Jul 4, 2024

@escaton I'm having the same issue, upgrading from 1.0.0-alpha.0 to 1.0.0-alpha.1, however I couldn't reproduce. using https://github.com/web-infra-dev/rspack-repro. Are you able to reproduce it?

@ahabhgk ahabhgk self-assigned this Jul 5, 2024
@escaton
Copy link
Contributor Author

escaton commented Jul 5, 2024

@markmssd unfortunately no. But I hope having a clear example and a subset of changes that led to bug should be enough.

@ahabhgk
Copy link
Collaborator

ahabhgk commented Jul 8, 2024

Fixed in 1.0.0-alpha.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants