You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The line padding: mod(50px, 51px); should be transformed to padding: 50px; and the custom media query @media (--medium-up) should be transformed to @media (min-width: 768px). However, Turbopack emits the following CSS:
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.
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 npm run dev-turbopack -w repro.
### 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>
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: