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
export * as namespace does not support string literals #4784
Comments
Ah, I overlooked you can do this with namespaces as well. The fix is probably very similar to what I did in #4770, if you want, you can have a shot at fixing this. |
Actually forget what I said, I have overlooked it but if it is a Syntax error, then the acorn parser has also overlooked it and it needs to be fixed in acorn. Until then, there is little we can do about it in Rollup. |
just tried export * as "foo" from "foo" acorn {
"type": "Program",
"start": 0,
"end": 28,
"body": [
{
"type": "ExportAllDeclaration",
"start": 0,
"end": 28,
"exported": {
"type": "Literal",
"start": 12,
"end": 17,
"value": "foo",
"raw": "\"foo\""
},
"source": {
"type": "Literal",
"start": 23,
"end": 28,
"value": "foo",
"raw": "\"foo\""
}
}
],
"sourceType": "module"
} rollup roll.js → bundle.js...
[!] RollupError: Unexpected token
roll.js (1:12)
1: export * as "foo" from "foo"
^
at error (/node_module/rollup/dist/shared/rollup.js:210:30)
at Module.error (/node_modules/rollup/dist/shared/rollup.js:13478:16)
at Module.tryParse (/node_modules/rollup/dist/shared/rollup.js:13872:25)
at Module.setSource (/node_modules/rollup/dist/shared/rollup.js:13763:39)
at ModuleLoader.addModuleSource (/node_modules/rollup/dist/shared/rollup.js:23404:20) |
Maybe we are not using the latest acorn version? I mean, tryParse from the stack trace is doing nothing but calling acorn. |
good point. debugged it a bit, and I'm fairly sure the parser error is being thrown by the |
The error points this line. Line 572 in d90f274
|
Fix at #5298. |
This issue has been resolved via #5298 as part of rollup@4.9.0. You can test it via |
I believe this is part of
arbitrary module namespace names
: #4322Rollup Version
v3.9.1
Operating System (or Browser)
n/a
Node Version (if applicable)
n/a
Link To Reproduction
https://rollupjs.org/repl/?version=3.9.1&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmV4cG9ydCUyMColMjBhcyUyMCU1QyUyMmZvbyU1QyUyMiUyMGZyb20lMjAlNUMlMjIuJTJGZm9vLmpzJTVDJTIyJTIyJTJDJTIyaXNFbnRyeSUyMiUzQXRydWUlN0QlMkMlN0IlMjJuYW1lJTIyJTNBJTIyZm9vLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmV4cG9ydCUyMGNvbnN0JTIwZm9vJTIwJTNEJTIwJ2JhciclMjIlMkMlMjJpc0VudHJ5JTIyJTNBZmFsc2UlN0QlNUQlMkMlMjJvcHRpb25zJTIyJTNBJTdCJTIyZm9ybWF0JTIyJTNBJTIyZXMlMjIlMkMlMjJuYW1lJTIyJTNBJTIybXlCdW5kbGUlMjIlMkMlMjJhbWQlMjIlM0ElN0IlMjJpZCUyMiUzQSUyMiUyMiU3RCUyQyUyMmdsb2JhbHMlMjIlM0ElN0IlN0QlN0QlMkMlMjJleGFtcGxlJTIyJTNBbnVsbCU3RA==
Expected Behaviour
Actual Behaviour
SyntaxError
The text was updated successfully, but these errors were encountered: