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
[Bug] : Using grid/column syntax breaks compilation #927
Comments
PR welcome |
Thanks for the report. This is because our plugins are modifying the AST. so I tried running all the normalized plugins first before the minify and reduce ones, like this [postcssDiscardComments, options.discardComments],
[postcssNormalizeUrl, options.normalizeUrl],
[postcssNormalizeString, options.normalizeString],
[postcssNormalizeRepeatStyle, options.normalizeRepeatStyle],
[postcssNormalizePositions, options.normalizePositions],
[postcssNormalizeWhitespace, options.normalizeWhitespace],
[postcssMinifyGradients, options.minifyGradients],
[postcssReduceInitial, options.reduceInitial],
[postcssSvgo, options.svgo],
[postcssNormalizeDisplayValues, options.normalizeDisplayValues],
[postcssReduceTransforms, options.reduceTransforms],
[postcssColormin, options.colormin],
[postcssNormalizeTimingFunctions, options.normalizeTimingFunctions],
[postcssCalc, options.calc],
[postcssConvertValues, options.convertValues],
[postcssOrderedValues, options.orderedValues],
[postcssMinifySelectors, options.minifySelectors],
[postcssMinifyParams, options.minifyParams],
[postcssNormalizeCharset, options.normalizeCharset],
[postcssDiscardOverridden, options.discardOverridden],
[postcssNormalizeUnicode, options.normalizeUnicode],
[postcssMinifyFontValues, options.minifyFontValues],
[postcssMergeLonghand, options.mergeLonghand],
[postcssDiscardDuplicates, options.discardDuplicates],
[postcssMergeRules, options.mergeRules],
[postcssDiscardEmpty, options.discardEmpty],
[postcssUniqueSelectors, options.uniqueSelectors],
[cssDeclarationSorter, options.cssDeclarationSorter],
[rawCache, options.rawCache], In the We can other wise add a check for the whether the if (Array.isArray(node[param])) {
newValue = normalize(node[param][0], preferredQuote);
} else {
newValue = normalize(node[param], preferredQuote);
} |
Why is reordering the plugins considered breaking? |
I am not sure whether it will be breaking change for sure or not. But there is a huge possibility that it will be a breaking change. |
Uses the temporary fix proposed by @4cm4k1 in vercel/next.js#15026, Timer/cssnano-preset-simple#6, and cssnano/cssnano#927. Also temporarily fixes Sass module resolution by using the Yarn v2 nodeLinker option (until it's fixed upstream; see vercel/next.js#15753).
Describe the bug
When I and others attempt to make a production build (
./node_modules/.bin/next build
) of our Next.js projects, compilation fails with an error, specificallyTypeError: f.charCodeAt is not a function
, seemingly as a result of using CSS grid and column syntax:grid-column: span 2;
(Build fails when using CSS grid-column shorthand syntax vercel/next.js#15026 (comment))columns: 2 auto;
(Build fails when using CSS grid-column shorthand syntax vercel/next.js#15026 (comment))import '@material/layout-grid/dist/mdc.layout-grid.css';
(How to get more verbose build output? Only production build fails with `TypeError: f.charCodeAt is not a function` vercel/next.js#14907)Additional notes from @vukers (Timer/cssnano-preset-simple#6 (comment)):
To Reproduce
Steps to reproduce the behavior:
yarn install
yarn build
Alternatively, per @vukers again (vercel/next.js#15026 (comment)):
Expected behavior
Builds successfully.
Screenshots
N/A
Desktop (please complete the following information):
npx envinfo && npm ls cssnano
here:Additional context
N/A
x-ref: vercel/next.js#15026
x-ref: Timer/cssnano-preset-simple#6
The text was updated successfully, but these errors were encountered: