Legacy Knowledge Base
Published Jul. 2, 2025

Theme build fails with error: @keyframes missing name near line

Written By

Alfonso Crisci

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • When building a 7.2 theme created with the Liferay Theme Generator (or inside a Liferay Workspace), the gulp build task will fail with error:
    [15:04:04] Starting 'build:r2'...
    events.js:174
    throw er; // Unhandled 'error' event
    ^

    Error: @keyframes missing name near line 16530:20
    at error (/themes/node_modules/liferay-css-parse/index.js:69:15)
    at atkeyframes (/themes/node_modules/liferay-css-parse/index.js:282:20)
    at atrule (/themes/node_modules/liferay-css-parse/index.js:502:12)
    at rules (/themes/node_modules/liferay-css-parse/index.js:112:58)
    at stylesheet (/themes/node_modules/liferay-css-parse/index.js:82:16)
    at module.exports (/themes/node_modules/liferay-css-parse/index.js:537:10)
    at r2 (/themes/node_modules/liferay-r2/r2.js:166:9)
    at Object.module.exports.swap (/themes/node_modules/liferay-r2/r2.js:216:10)
    at swapBuffer (/themes/node_modules/gulp-liferay-r2-css/index.js:39:26)
    at DestroyableTransform._transform (/themes/node_modules/gulp-liferay-r2-css/index.js:19:21)
    at DestroyableTransform.Transform._read (/themes/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/themes/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:83)
    at doWrite (/themes/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/themes/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at DestroyableTransform.Writable.write (/themes/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Transform.ondata (_stream_readable.js:667:20)
    at Transform.emit (events.js:189:13)
    at addChunk (_stream_readable.js:284:12)
    at readableAddChunk (_stream_readable.js:265:11)
    at Transform.Readable.push (_stream_readable.js:220:10)
    at Transform.push (_stream_transform.js:151:32)
    at Transform.afterTransform (_stream_transform.js:92:10)
    at Transform.stream._transform (/themes/node_modules/gulp-rename/index.js:63:5)
    at Transform._read (_stream_transform.js:190:10)
    at Transform._write (_stream_transform.js:178:12)
    at doWrite (_stream_writable.js:410:12)
    at writeOrBuffer (_stream_writable.js:394:5)
    at Transform.Writable.write (_stream_writable.js:294:11)
    at write (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:664:5)
    at DestroyableTransform.emit (events.js:189:13)
    at emitReadable_ (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:448:10)
    at emitReadable (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:444:5)
    at readableAddChunk (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:187:9)
    at DestroyableTransform.Readable.push (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:149:10)
    at DestroyableTransform.Transform.push (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_transform.js:145:32)
    at afterTransform (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_transform.js:101:12)
    at TransformState.afterTransform (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_transform.js:79:12)
    at DestroyableTransform.noop [as _transform] (/themes/node_modules/vinyl-fs/node_modules/through2/through2.js:26:3)
    at DestroyableTransform.Transform._read (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at DestroyableTransform.Writable.write (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:664:5)
    at DestroyableTransform.emit (events.js:189:13)
    at emitReadable_ (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:448:10)
    at emitReadable (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:444:5)
    at readableAddChunk (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:187:9)
    at DestroyableTransform.Readable.push (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:149:10)
    at DestroyableTransform.Transform.push (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_transform.js:145:32)
    at afterTransform (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_transform.js:101:12)
    at TransformState.afterTransform (/themes/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_transform.js:79:12)
    at /themes/node_modules/vinyl-fs/lib/src/getContents/bufferFile.js:12:5
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

    Emitted 'error' event at:
    at DestroyableTransform.onerror (_stream_readable.js:691:12)
    at DestroyableTransform.emit (events.js:189:13)
    at DestroyableTransform._transform (/themes/node_modules/gulp-liferay-r2-css/index.js:24:10)
    at DestroyableTransform.Transform._read (/themes/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    [... lines matching original stack trace ...]

    > Task :themes:gulpBuild FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':themes:gulpBuild'.
    > Process 'command '/build/node/bin/node'' finished with non-zero exit value 1

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 1m 2s
    3 actionable tasks: 3 executed

Environment

  • Liferay DXP 7.2
  • liferay-js-themes-toolkit v. 9.4.1
    "devDependencies": {
    "gulp": "3.9.1",
    "liferay-theme-tasks": "^9.4.1",
    "compass-mixins": "0.12.10",
    "liferay-frontend-common-css": "1.0.4",
    "liferay-frontend-theme-styled": "4.0.7",
    "liferay-frontend-theme-unstyled": "4.0.4",
    "liferay-font-awesome": "3.4.0"
    }

Resolution

  • Search within all the custom .css or .scss files for all occurrences of the rule @keyframes or @-webkit-keyframes not followed by a plain string representing the animation name. Make the corrections by removing any foreign signs (e.g. quotes, double quotes, code comments) before or around the animation name. For example:

    🔴 WRONG:
@keyframes "mymove" {
from {top: 0px;}
to {top: 200px;}
}


✅ CORRECT:

@keyframes mymove {
from {top: 0px;}
to {top: 200px;}
}
    Once done, re-build the theme.

 

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base