question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[2.0] Invalid configuration file `...`: parent.eval is not a function

See original GitHub issue

Environments:

  • 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:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
wKovacs64commented, Mar 21, 2020

Same. Seems to be an issue with the JavaScript (prettier.config.js) method of configuration. Changing my config to JSON in .prettierrc works.

3reactions
thorn0commented, Mar 21, 2020

2.0.1 is on npm 🎉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found