Skip to content

Conversation

@flolbr
Copy link

@flolbr flolbr commented Oct 18, 2022

When running on a React component with the better-docs/component plugin enabled, this error shows up:

C:\<project_path>\node_modules\better-docs\component.js:68
      throw error
      ^

ConfigError: [BABEL] unknown file: Preset /* your preset */ requires a filename to be set when babel is called directly,
```
babel.transformSync(code, { filename: 'file.ts', presets: [/* your preset */] });
```
See https://babeljs.io/docs/en/options#filename for more information.

It appeared to be caused by the call to reactDocs.parse() in component.js:58.

By passing an empty filename argument (since it is not used anyway), the error stops being thrown and the doc builds fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant