[2.0] Invalid configuration file `...`: parent.eval is not a function
See original GitHub issueEnvironments:
- Prettier Version: 2.0.0
- Running Prettier via: CLI
- Runtime: Node 10.10 AND 12.16
- Operating System: mac osx
Steps to reproduce:
Once updating to 2.0, all my prettier commands are failing, across all my projects. It’s always the same error:
[error] Invalid configuration file `packages/config/src/configs/babel.ts`: parent.eval is not a function
I tried the following command on Node 10 AND 12, and it’s the same error.
npx prettier packages/config/src/configs/babel.ts --write
Also fails with or without --write
.
My prettier.config.js
:
module.exports = {
arrowParens: 'always',
bracketSpacing: true,
endOfLine: 'lf',
jsxBracketSameLine: false,
printWidth: 100,
proseWrap: 'always',
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
useTabs: false,
};
Expected behavior:
It works.
Actual behavior:
It doesn’t.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:7 (4 by maintainers)
Top Results From Across the Web
ESLintPlugin TS and JS Hybrid: ERROR in parent.eval is not a ...
eval is not a function Occurred while linting C:\fakepath\ts-test\resources\js\app.ts:7 webpack compiled with 1 error No issues found.
Read more >How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >eval() - JavaScript - MDN Web Docs - Mozilla
The eval() function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script.
Read more >eval: Evaluate an (Unevaluated) Expression - Rdrr.io
frame , parent.frame , environment . Further, force to force evaluation, typically of function arguments. Examples. eval(2 ^ ...
Read more >ECMAScript modules | Node.js v19.3.0 Documentation
addTwo.mjs function addTwo(num) { return num + 2; } export { addTwo }; ... Absolute specifiers like 'file:///opt/nodejs/config.js' .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same. Seems to be an issue with the JavaScript (
prettier.config.js
) method of configuration. Changing my config to JSON in.prettierrc
works.2.0.1 is on npm 🎉