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.

Potential Breaking Change in `resolveConfig`

See original GitHub issue

It seems that 2.0 may have introduced an unintended breaking change in the resolveConfig function. This function is used in the Prettier VS Code extension here: https://github.com/prettier/prettier-vscode/blob/master/src/ConfigResolver.ts#L99

Since upgrading to 2.0 we are now seeing errors when trying to resolve configs:

Error: Cannot find module 'prettier-config-greenelab' from 'c:\Users\Vincent\Desktop\adage-frontend'
	at Function.Module._resolveFilename (internal/modules/cjs/loader.js:717:15)
	at Function.n.resolve (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:15:584)
	at Object.transform (c:\Users\Vincent\.vscode\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\index.js:23283:40)
	at run (c:\Users\Vincent\.vscode\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11472:51)
	at async cacheWrapper (c:\Users\Vincent\.vscode\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11300:20)
	at async cacheWrapper (c:\Users\Vincent\.vscode\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11300:20)
	at async cacheWrapper (c:\Users\Vincent\.vscode\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11300:20)
	at async cacheWrapper (c:\Users\Vincent\.vscode\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11300:20)
	at async cacheWrapper (c:\Users\Vincent\.vscode\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11300:20)
	at async Explorer.search (c:\Users\Vincent\.vscode\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11457:22)
	at async Promise.all (index 0)

For repro steps and more details see: https://github.com/prettier/prettier-vscode/issues/1289

One thing to note, is that everything behaves as expected from the CLI which is odd.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:32 (30 by maintainers)

github_iconTop GitHub Comments

2reactions
thorn0commented, Apr 4, 2020

Okay, I’m about to submit a PR.

1reaction
thorn0commented, Apr 4, 2020

I have a fix: require('module').createRequire(dir).resolve.length === 2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migration Guide | Detox
These migration guides refer to breaking changes. If a newer version has no entries in this document, it means it does not require...
Read more >
breaking change since webpack 5: the devtool option is more strict.
In Webpack 4 it was possible to value this with an empty string. webpack 5 is more strict. Webpacks devtool configuration. Open side...
Read more >
Changelog
Breaking changes. cssnano & its plugins have been upgraded to PostCSS 6.x. Please ensure that for optimal results that you use cssnano with ......
Read more >
Blog | Detekt
A silent configuration would exclude all possible processors and reports ... in the older versions due to breaking changes in RC13 and RC15....
Read more >
Configuration System
Default values also become hard to change without breaking backwards compatibility. ... config.cfg") resolved = registry.resolve(config) optimizer ...
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