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

JisonLexerError: Lexical error on line 1: Unrecognized text #101

Closed
rahulvanmali21 opened this issue Nov 28, 2019 · 6 comments
Closed

JisonLexerError: Lexical error on line 1: Unrecognized text #101

rahulvanmali21 opened this issue Nov 28, 2019 · 6 comments

Comments

@rahulvanmali21
Copy link

Erroneous area:
1: 1.6em + 0.75rem2px
^...........^
at D:\css\app.css:31141:3
at Object.parseError (D:\DigitalStationary\node_modules\postcss-calc\dist\parser.js:1164:15)
at Object.lexer_parseError [as parseError] (D:\DigitalStationary\node_modules\postcss-calc\dist\parser.js:2297:44)
at Object.lexer_next [as next] (D:\DigitalStationary\node_modules\postcss-calc\dist\parser.js:3292:22)
at Object.lexer_fastLex [as fastLex] (D:\DigitalStationary\node_modules\postcss-calc\dist\parser.js:3367:18)
at fastLex (D:\DigitalStationary\node_modules\postcss-calc\dist\parser.js:1567:27)
at Parser.parse (D:\DigitalStationary\node_modules\postcss-calc\dist\parser.js:1641:30)
at D:\DigitalStationary\node_modules\postcss-calc\dist\lib\transform.js:30:30
at walk (D:\DigitalStationary\node_modules\postcss-value-parser\lib\walk.js:19:7)
at ValueParser.walk (D:\DigitalStationary\node_modules\postcss-value-parser\lib\index.js:18:3)
at transformValue (D:\DigitalStationary\node_modules\postcss-calc\dist\lib\transform.js:24:50)
at _default (D:\DigitalStationary\node_modules\postcss-calc\dist\lib\transform.js:59:100)
at D:\DigitalStationary\node_modules\postcss-calc\dist\index.js:25:51
at D:\DigitalStationary\node_modules\postcss\lib\container.js:135:18
at Rule.each (D:\DigitalStationary\node_modules\postcss\lib\container.js:101:16)
at Rule.walk (D:\DigitalStationary\node_modules\postcss\lib\container.js:131:17)
at D:\DigitalStationary\node_modules\postcss\lib\container.js:148:24
at Root.each (D:\DigitalStationary\node_modules\postcss\lib\container.js:101:16)
at Root.walk (D:\DigitalStationary\node_modules\postcss\lib\container.js:131:17)
at D:\DigitalStationary\node_modules\postcss-calc\dist\index.js:23:9
at initializePlugin (D:\DigitalStationary\node_modules\cssnano\dist\index.js:31:51)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@ruibarbosareb
Copy link

same mistake.
Any solution?

@iamnimnul
Copy link

Same here ;)

🚨  /app/frontend/src/assets/css/main.scss:undefined:undefined: Lexical error on line 1: Unrecognized text.

  Erroneous area:
1: 1.5em + 0.75rem2px
^...........^

  Erroneous area:
1: 1.5em + 0.75rem2px
^...........^
    at /app/frontend/src/assets/css/main.scss:1988:3
    at Object.parseError (/app/frontend/node_modules/postcss-calc/dist/parser.js:1164:15)
    at Object.lexer_parseError [as parseError] (/app/frontend/node_modules/postcss-calc/dist/parser.js:2297:44)
    at Object.lexer_next [as next] (/app/frontend/node_modules/postcss-calc/dist/parser.js:3292:22)
    at Object.lexer_fastLex [as fastLex] (/app/frontend/node_modules/postcss-calc/dist/parser.js:3367:18)
    at fastLex (/app/frontend/node_modules/postcss-calc/dist/parser.js:1567:27)
    at Parser.parse (/app/frontend/node_modules/postcss-calc/dist/parser.js:1641:30)
    at /app/frontend/node_modules/postcss-calc/dist/lib/transform.js:30:30
    at walk (/app/frontend/node_modules/postcss-value-parser/lib/walk.js:19:7)
    at ValueParser.walk (/app/frontend/node_modules/postcss-value-parser/lib/index.js:18:3)
    at transformValue (/app/frontend/node_modules/postcss-calc/dist/lib/transform.js:24:50)
npm ERR! code ELIFECYCLE

I'm using parceljs 1.12.4, node v10.16.0, npm 6.9.0 on docker node:10-alpine image. It's bootstrap code causing a problem:
https://github.com/twbs/bootstrap/blob/v4.3.1/dist/css/bootstrap.css#L1860
or
https://github.com/twbs/bootstrap/blob/v4.3.1/scss/_variables.scss#L495

@iamnimnul
Copy link

Solution is on parceljs website:
https://parceljs.org/css.html#set-cssnano-minify-config

create a file cssnano.config.js next to package.json with a content:

module.exports = {
  preset: [
    'default',
    {
      calc: false,
      discardComments: {
        removeAll: true
      }
    }
  ]
};

@jasminexie
Copy link
Contributor

The current master branch of postcss calc has fixed these errors. I believe there are difficulties that prevent the maintainer from publishing; you can either specify postcss calc to point to this github repo, or you can disable it.

@alexander-akait
Copy link
Collaborator

cssnano/cssnano#833

@ludofischer
Copy link
Collaborator

Not enough info to reproduce, the bootstrap code pointed at in one comment compiles as of postcss-calc 8.2.0 Since #137 postcss-calc should not throw when encountering invalid CSS.

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

No branches or pull requests

6 participants