Skip to content

LexerError: Lexical error on line 1: Unrecognized text. #3565

@andreierdoss

Description

@andreierdoss

Describe the bug
In production (Heroku) assets fail to compile due to a lack of interpolation for an SCSS variable. Locally it compiles without issues. From my research, it seems that the $avatar-size variable should be wrapped in #{} Similar issue was found here.

Reproduction steps
git push heroku master

Expected behavior
Assets should compile with any issues.

Additional context

  • rails version: 6
  • rails_admin version: 3.1.0
  • rails_admin npm package version: 3.1.0
  • line code causing the error I noticed that in that file, some variables use interpolation others don't.
  • full stack trace (if there's an exception)
remote:        JisonLexerError: Lexical error on line 1: Unrecognized text.
remote:
remote:          Erroneous area:
remote:        1: (40px - $avatar-size) / 2
remote:        ^..........^
remote:            at /tmp/build_0af411aa/css/rails_admin-86279344.css:14:202126
remote:            at Object.parseError (/tmp/build_0af411aa/node_modules/postcss-calc/dist/parser.js:1200:15)
remote:            at Object.lexer_parseError [as parseError] (/tmp/build_0af411aa/node_modules/postcss-calc/dist/parser.js:2333:44)
remote:            at Object.lexer_next [as next] (/tmp/build_0af411aa/node_modules/postcss-calc/dist/parser.js:3328:22)
remote:            at Object.lexer_fastLex [as fastLex] (/tmp/build_0af411aa/node_modules/postcss-calc/dist/parser.js:3403:18)
remote:            at fastLex (/tmp/build_0af411aa/node_modules/postcss-calc/dist/parser.js:1603:27)
remote:            at Parser.parse (/tmp/build_0af411aa/node_modules/postcss-calc/dist/parser.js:1677:30)
remote:            at /tmp/build_0af411aa/node_modules/postcss-calc/dist/lib/transform.js:33:30
remote:            at walk (/tmp/build_0af411aa/node_modules/postcss-calc/node_modules/postcss-value-parser/lib/walk.js:7:16)
remote:            at ValueParser.walk (/tmp/build_0af411aa/node_modules/postcss-calc/node_modules/postcss-value-parser/lib/index.js:18:3)
remote:            at transformValue (/tmp/build_0af411aa/node_modules/postcss-calc/dist/lib/transform.js:24:50)
remote:            at _default (/tmp/build_0af411aa/node_modules/postcss-calc/dist/lib/transform.js:66:100)
remote:            at /tmp/build_0af411aa/node_modules/postcss-calc/dist/index.js:27:32
remote:            at /tmp/build_0af411aa/node_modules/postcss/lib/container.js:135:18
remote:            at Rule.each (/tmp/build_0af411aa/node_modules/postcss/lib/container.js:101:16)
remote:            at Rule.walk (/tmp/build_0af411aa/node_modules/postcss/lib/container.js:131:17)
remote:            at /tmp/build_0af411aa/node_modules/postcss/lib/container.js:148:24
remote:            at Root.each (/tmp/build_0af411aa/node_modules/postcss/lib/container.js:101:16)
remote:            at Root.walk (/tmp/build_0af411aa/node_modules/postcss/lib/container.js:131:17)
remote:            at /tmp/build_0af411aa/node_modules/postcss-calc/dist/index.js:23:9
remote:            at initializePlugin (/tmp/build_0af411aa/node_modules/cssnano/dist/index.js:31:51)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions