google / google/closure-compiler

Parse Error for "export * as X from ..."

Open
#4,177 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

`test.js`
```js
export * as boom from "./a.js";
```

running `npx google-closure-compiler --js test.js` (Version `20240317.0.0`) leads to

```
test.js:1:9: ERROR - [JSC_PARSE_ERROR] Parse error. 'from' expected
1| export * as boom from "./a.js";
^

1 error(s), 0 warning(s)
```

I didn't know this existed, but apparently some npm packages use it and it breaks compilation with shadow-cljs, see https://github.com/thheller/shadow-cljs/issues/1190.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the parse error with the provided test.js and the documented google-closure-compiler command at version 20240317.0.0. Trace the parser's handling of export declarations, then verify that compiling `export * as boom from "./a.js";` succeeds without the JSC_PARSE_ERROR.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.