It is obvious that it is an error of babel plugin, not Microbundle, but I couldn't find which plugin causes the problem. So I hereby register an issue here to track this problem.
How to reproduce error
Execute this script in an empty directory
#!/bin/bash
cat > package.json <<< '{"devDependencies":{"microbundle":"0.12.3"}}'
cat > index.js <<'EOF'
function* one() { yield 1 }
export function* two() {
const { value } = one().next()
yield value
}
EOF
yarn
yarn microbundle --target=node
Expected result
Build "bla" to dist:
415 B: bla.js.gz
352 B: bla.js.br
Actual result
WARN missing package.json "name" field. Assuming "b".
(babel plugin) TypeError: /home/simnalamburt/workspace/b/index.js: Property name expected type of string but got null
TypeError: /home/simnalamburt/workspace/b/index.js: Property name expected type of string but got null
at validate (/home/simnalamburt/workspace/b/node_modules/@babel/types/lib/definitions/utils.js:160:13)
at Object.validate (/home/simnalamburt/workspace/b/node_modules/@babel/types/lib/definitions/utils.js:229:7)
at validateField (/home/simnalamburt/workspace/b/node_modules/@babel/types/lib/validators/validate.js:24:9)
at validate (/home/simnalamburt/workspace/b/node_modules/@babel/types/lib/validators/validate.js:17:3)
at builder (/home/simnalamburt/workspace/b/node_modules/@babel/types/lib/builders/builder.js:38:27)
at Object.identifier (/home/simnalamburt/workspace/b/node_modules/@babel/types/lib/builders/generated/index.js:340:31)
at /home/simnalamburt/workspace/b/node_modules/regenerator-transform/lib/hoist.js:32:29
at Array.forEach (<anonymous>)
at varDeclToExpr (/home/simnalamburt/workspace/b/node_modules/regenerator-transform/lib/hoist.js:29:23)
at exit (/home/simnalamburt/workspace/b/node_modules/regenerator-transform/lib/hoist.js:51:20)

It is obvious that it is an error of babel plugin, not Microbundle, but I couldn't find which plugin causes the problem. So I hereby register an issue here to track this problem.
How to reproduce error
Execute this script in an empty directory
Expected result
Actual result