-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression TypeScript parser: "Critical dependency: the request of a dependency is an expression" #12338
Comments
I confirm this seems to be broken since |
I'm not sure how to reproduce this. |
I've moved this to 2.7 milestone, to unblock v2.6 release, but we can release a patch release if necessary. |
I got this error on 2.6.0 , fallback 2.5.1to is OK |
I can't help without a reproduction. |
What's the issue I explain how to reproduce in the issue + linked to a bunch of other tickets which have further reproductions. Would you like me to create a repo for the reproduction? |
Yes, please. |
With create react app: yarn create react-app prettier-bug
cd prettier-bug
yarn add prettier
vi src/App.js
yarn start Main change looks like: diff --git a/package.json b/package.json
index 4fcd053..2b6e0c5 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,7 @@
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
+ "prettier": "^2.6.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "5.0.0",
diff --git a/src/App.js b/src/App.js
index 3784575..6b6dbe2 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,7 +1,8 @@
-import logo from './logo.svg';
-import './App.css';
+import logo from "./logo.svg";
+import "./App.css";
function App() {
+ console.log(import("prettier/parser-typescript"));
return (
<div className="App">
<header className="App-header">
diff --git a/yarn.lock b/yarn.lock
index 3cd6d5d..c898d48 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6852,6 +6852,11 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
+prettier@^2.6.0:
+ version "2.6.0"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.0.tgz#12f8f504c4d8ddb76475f441337542fa799207d4"
+ integrity sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==
+
pretty-bytes@^5.3.0, pretty-bytes@^5.4.1:
version "5.6.0"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" Output looks like: I see that the error is different that what I originally posted, but I'm sure create react app is doing some more fancier things. By default raw webpack will spit out the error that I have shown in my original post. |
Thank you, I'll take a look. |
I was able to reproduce on CI now, https://github.com/prettier/prettier/runs/5595666668?check_suite_focus=true#step:6:6, I'll look into it. |
Looks like a regression of #11269 and #11076
Environments:
Steps to reproduce:
Add this line of code to repo that has webpack:
Expected behavior:
No warnings
Actual behavior:
Big webpack warning about "Critical dependency: the request of a dependency is an expression"
The text was updated successfully, but these errors were encountered: