getting babel related issues when generating documentation
Getting babel related issues when running: documentation build './packages/*' -f html -o docs --document-exported --babel=./babel.config.js
I am not sure what should babel.config.js have to support the error that generating! I have babel 7 defined on package.json.
Error:
SyntaxError: Unexpected token, expected ";" (2:10) at _temp._raise (/x/.config/yarn/global/node_modules/documentation/node_modules/@babel/parser/lib/index.js:799:17) at _temp.raiseWithData (/xj/.config/yarn/global/node_modules/documentation/node_modules/@babel/parser/lib/index.js:792:17) at _temp.raise (/x/.config/yarn/global/node_modules/documentation/node_modules/@babel/parser/lib/index.js:786:17) at _temp.unexpected (/x/.config/yarn/global/node_modules/documentation/node_modules/@babel/parser/lib/index.js:9089:16) at _temp.semicolon (/x.config/yarn/global/node_modules/documentation/node_modules/@babel/parser/lib/index.js:9071:40) at _temp.parseExpressionStatement (/xj/.config/yarn/global/node_modules/documentation/node_modules/@babel/parser/lib/index.js:12117:10)
- What version of documentation.js are you using?: 13.1.0
- How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): CLI
This needs a testcase and a code example, there's no way to tell what input in particular is triggering this.
I am getting the exact same error. Would be easier to debug if the parser could print out the path of the file that is causing the error !
Any update on this? I am also getting this same error.
hello, could you please check on master, do you have the same error?
Top level await is what was causing this issue for me. This is the input that was throwing:
import { readdir } from 'fs/promises';
import { resolve } from 'path';
const dir = process.argv.pop();
if (!dir) throw new Error('missing path parameter');
const definitions = await readdir(resolve(process.cwd(), dir));
Error location is line 8, col 26, which is the end of the await on the last line.