Skip to content
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

CSS transform: translate3d fails to minify #920

Closed
Timer opened this issue Jun 27, 2020 · 3 comments
Closed

CSS transform: translate3d fails to minify #920

Timer opened this issue Jun 27, 2020 · 3 comments
Labels
Milestone

Comments

@Timer
Copy link
Collaborator

Timer commented Jun 27, 2020

Describe the bug

TypeError: Cannot read property 'type' of undefined
    at /Users/joe/Documents/Development/Work/zeit/next.js/static/css/83f915061ddb4839a422.css:21:3
    at stringifyNode (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss-value-parser/lib/stringify.js:2:19)
    at stringify (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss-value-parser/lib/stringify.js:41:16)
    at stringifyNode (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss-value-parser/lib/stringify.js:19:11)
    at stringify (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss-value-parser/lib/stringify.js:41:16)
    at ValueParser.toString (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss-value-parser/lib/index.js:14:38)
    at /Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss-reduce-transforms/dist/index.js:213:82
    at /Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss/lib/container.js:198:18
    at /Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss/lib/container.js:135:18
    at Rule.each (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss/lib/container.js:101:16)
    at Rule.walk (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss/lib/container.js:131:17)
    at /Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss/lib/container.js:148:24
    at Root.each (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss/lib/container.js:101:16)
    at Root.walk (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss/lib/container.js:131:17)
    at Root.walkDecls (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss/lib/container.js:196:19)
    at /Users/joe/Documents/Development/Work/zeit/next.js/node_modules/postcss-reduce-transforms/dist/index.js:204:13
    at initializePlugin (/Users/joe/Documents/Development/Work/zeit/next.js/node_modules/cssnano/dist/index.js:31:51) {
  postcssNode: Declaration {
    raws: { before: '\n  ', between: ':' },
    type: 'decl',
    parent: Rule {
      raws: [Object],
      type: 'rule',
      nodes: [Array],
      parent: [Root],
      source: [Object],
      selector: '.transform-parsing',
      lastEach: 6,
      indexes: [Object]
    },
    source: { start: [Object], input: [Input], end: [Object] },
    prop: 'transform',
    value: 'translate3d(0px, 0px)'
  }
}

To Reproduce

.transform-parsing {
  transform: translate3d(0px, 0px);
}

Expected behavior

Should not crash.

Screenshots
If applicable, add screenshots to help explain your problem. (from cssnano-playground)

Desktop (please complete the following information):

  • CSSNANO Version: cssnano@4.1.10
@Timer
Copy link
Collaborator Author

Timer commented Jun 27, 2020

This might be fixed on master already. Any chance a new version of cssnano can be released?

@anikethsaha
Copy link
Member

Thanks for the report.

Yes this has been fixed in the master and the output is .transform-parsing{transform:translate3d(0,0)}

About the release, I hope it will be done soon.

I have created a kind of workaround in which you can use the updated master code using cssnano-nightly.
Though I will not recommend that for production as I made that yesterday itself so may notice some bug.

@ludofischer ludofischer added this to the 5.0.0 milestone Mar 19, 2021
@ludofischer
Copy link
Collaborator

Fixed in 5.0.0-rc.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants