-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[turbopack] Local PostCSS configuration is not applied to CSS files imported from node_modules when using workspaces #5068
Labels
kind: bug
Something isn't working
Comments
dstaley
added
area: turbopack
kind: bug
Something isn't working
needs: triage
New issues get this label. Remove it after triage
labels
May 22, 2023
This is basically the same bug as #4861 (which 13.4.3 fixes) except the issue only occurs when the Next.js application is within an npm workspace. This isn't Turborepo specific, and reproduces when calling |
Same problem. need help |
padmaia
added
linear: web
and removed
needs: triage
New issues get this label. Remove it after triage
labels
Sep 20, 2023
kwonoj
added a commit
that referenced
this issue
Oct 17, 2023
### Description - closes #5068 For the postcss transform specific, there's no gaurantee if we lookup context from the path of the source as we allow to include import outside of the project root as resolvable. PR amends lookup behavior for the config, that looks for the project root first then try to use source path later. Closes WEB-1719 --------- Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
ForsakenHarmony
pushed a commit
to vercel/next.js
that referenced
this issue
Jul 25, 2024
### Description - closes vercel/turborepo#5068 For the postcss transform specific, there's no gaurantee if we lookup context from the path of the source as we allow to include import outside of the project root as resolvable. PR amends lookup behavior for the config, that looks for the project root first then try to use source path later. Closes WEB-1719 --------- Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
ForsakenHarmony
pushed a commit
to vercel/next.js
that referenced
this issue
Jul 29, 2024
### Description - closes vercel/turborepo#5068 For the postcss transform specific, there's no gaurantee if we lookup context from the path of the source as we allow to include import outside of the project root as resolvable. PR amends lookup behavior for the config, that looks for the project root first then try to use source path later. Closes WEB-1719 --------- Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
ForsakenHarmony
pushed a commit
to vercel/next.js
that referenced
this issue
Aug 1, 2024
### Description - closes vercel/turborepo#5068 For the postcss transform specific, there's no gaurantee if we lookup context from the path of the source as we allow to include import outside of the project root as resolvable. PR amends lookup behavior for the config, that looks for the project root first then try to use source path later. Closes WEB-1719 --------- Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Next.js are you using Turbopack in?
13.4.3 (also confirmed in 13.5.2 on September 20 2023)
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Linux
Describe the Bug
When a workspace with a Next.js application is configured with a local PostCSS config file, CSS files imported from node_modules do not have locally-configured transformations applied.
For example, given the following:
node_modules/@localhostonly/button/style.module.css
node_modules/@localhostonly/global-styles/custom-media.css
apps/repro/postcss.config.js
The line
padding: mod(50px, 51px);
should be transformed topadding: 50px;
and the custom media query@media (--medium-up)
should be transformed to@media (min-width: 768px)
. However, Turbopack emits the following CSS:This does not match the CSS emitted by Next.js when running without Turbopack, or when the application is run outside of a monorepo using Turbopack.
Expected Behavior
CSS files imported from node_modules in applications stored in a workspace are transformed according to the locally supplied PostCSS configuration.
To Reproduce
npm install
npm run make-package
npx turbo run dev
, open localhost:3000, and confirm that the two buttons are equal in size, that in viewports narrower than 768px the buttons are orange, and that in viewports wider than 768px the buttons are aqua.npx turbo run dev-turbopack
, open localhost:3000, and confirm that the "node_modules button" button has no padding, and that in viewports wider than 768px the "node_modules button" button remains orange.Reproduction Repo
https://github.com/dstaley/turborepo-turbopack-postcss
WEB-1614
The text was updated successfully, but these errors were encountered: