tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Lexical error - Unrecognized text after update to 2.0

Open IgorHalfeld opened this issue 6 years ago • 12 comments

After updating the @nuxt/tailwind version, this error appears to me

Version

@nuxtjs/tailwindcss: 2.0.0 nuxt: 2.0.0 node: 12.16.3

Steps to reproduce

npm run build

What is Expected?

Build succeeded

What is actually happening?

ERROR in ./assets/css/tailwind.css (./node_modules/css-loader/dist/cjs.js??ref--3-oneOf-1-1!./node_modules/postcss-loader/src??ref--3-oneOf-1-2!./assets/css/tailwind.css)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
JisonLexerError: Lexical error on line 1: Unrecognized text.

  Erroneous area:
1: 7rem; * calc(1 - var(--space-y-reverse))
^......^
    at /app/node_modules/tailwindcss/utilities.css:1:1
    at Object.parseError (/app/node_modules/postcss-calc/dist/parser.js:1200:15)
    at Object.lexer_parseError [as parseError] (/app/node_modules/postcss-calc/dist/parser.js:2333:44)

image

image

IgorHalfeld avatar May 09 '20 01:05 IgorHalfeld

Can you please rm -rf node_modules/ and npm or yarn install again?

atinux avatar May 13 '20 15:05 atinux

I forgot to mention that this happens in the deployment process. Then it goes through the entire flow through a docker image

FROM keymetrics/pm2:12-slim
WORKDIR /app
COPY ./package.json  .

RUN rm -rf node_modules
RUN npm install

WORKDIR /app
COPY --from=intermediate /app .
COPY ./ .

RUN npm run build

EXPOSE 80
CMD [ "pm2-runtime", "start", "ecosystem.config.js" ]

IgorHalfeld avatar May 15 '20 23:05 IgorHalfeld

That line is intriguing to me: 7rem; * calc(1 - var(--space-y-reverse)) What's the function of * here? Could you provide the source context of this line?

mornir avatar May 24 '20 07:05 mornir

@mornir this line isn't on my source code 🤯 Probably is from tailwind's source code

IgorHalfeld avatar May 24 '20 07:05 IgorHalfeld

ah ok 😅

mornir avatar May 24 '20 08:05 mornir

experiencing same weirdness extending maxWidth and getting a blocker with auto * calc(1 - var(--space-y-reverse)).

Actual Error:

ERROR in ./src/css/main.css (./node_modules/postcss-loader/src??ref--5-2!./src/css/main.css)
    Module build failed (from ./node_modules/postcss-loader/src/index.js):

still investigating...

ricricucit avatar Jun 16 '20 14:06 ricricucit

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 15 '20 19:08 stale[bot]

👀

IgorHalfeld avatar Aug 15 '20 22:08 IgorHalfeld

Do you have any reproduction I could look at?

atinux avatar Sep 03 '20 17:09 atinux

I recently ran into this issue when updating to 2.0

I am running into the issue, when trying to change or extend spacing.

This is my spacing config:

extend: {
  spacing: { ...spacing },
}

Spacing:

module.exports = {
  'full': '100%',
  'auto': 'auto',
  'initial': 'initial',
  '0': '0rem'
}

knynkwl avatar Mar 06 '21 01:03 knynkwl

I figure out that has to do with:

full': '100%',
'auto': 'auto',
'initial': 'initial',

knynkwl avatar Mar 06 '21 01:03 knynkwl

I'm not sure why this is closed but here is the fix:

  • Go to your TailwindCSS config file, in my case is tailwind.js
  • Remove auto: 'auto' from theme.spacing

Fixed!

andresfigueira avatar May 20 '21 21:05 andresfigueira