HUGO

[OT]: POSTCSS:Cannot read property 'prefix_exceptions' of undefined

Hi,

Even if ı did not change anything except contents I suddenly received below error. I can’t figure out to solve this. Can someone help?

#15 0.585 Start building sites …                                                                                                                                                                                                        
#15 3.500 Total in 2989 ms
#15 3.500 Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): TypeError: Cannot read property 'prefix_exceptions' of undefined
#15 3.500     at Browsers.prefix (/app/node_modules/autoprefixer/lib/browsers.js:64:23)
#15 3.500     at /app/node_modules/autoprefixer/lib/prefixes.js:135:54
#15 3.500     at Array.map (<anonymous>)
#15 3.500     at Prefixes.select (/app/node_modules/autoprefixer/lib/prefixes.js:135:31)
#15 3.500     at new Prefixes (/app/node_modules/autoprefixer/lib/prefixes.js:75:53)
#15 3.500     at loadPrefixes (/app/node_modules/autoprefixer/lib/autoprefixer.js:107:22)
#15 3.500     at Object.prepare (/app/node_modules/autoprefixer/lib/autoprefixer.js:117:22)
#15 3.500     at /app/node_modules/postcss/lib/lazy-result.js:133:39
#15 3.500     at Array.map (<anonymous>)
#15 3.500     at new LazyResult (/app/node_modules/postcss/lib/lazy-result.js:131:43)

Here is my Dockerfile

FROM alpine:latest AS build
WORKDIR /app
ARG AUDIENCE
ARG ENVIRONMENT
RUN sed -i.bak 's+https://+http://+' /etc/apk/repositories
RUN apk --no-cache add curl git libc6-compat libstdc++ npm
RUN npm install -D --save postcss && \
npm install -D autoprefixer && \
npm install -D --save postcss-cli
RUN curl -L -o /tmp/hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.78.0/hugo_extended_0.78.0_Linux-64bit.tar.gz \&& tar xzf /tmp/hugo.tar.gz -C /usr/local/bin/
COPY . .

RUN if [ "$ENVIRONMENT" = "production" ] ; then hugo -e ${AUDIENCE} --minify ; else hugo -e ${AUDIENCE} --minify; fi

FROM nginx:latest
COPY --from=build /app/public /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
RUN chgrp -R root /var/cache/nginx /var/run /var/log/nginx && \
chmod -R 770 /var/cache/nginx /var/run /var/log/nginx
EXPOSE 8081
CMD ["nginx", "-g", "daemon off;"]

This error is not related to Hugo. (have a look over here for an error similar to yours)

Please ask at the PostCSS support channels.

Also in the future, please refrain from posting long error messages on topic titles, it pollutes the forum.

Thank you for the understanding.

Hi @onedrawingperday ,

You re right sorry for that. Just for reference, below fixed my issue

RUN npm install postcss && \
    npm install autoprefixer && \
    npm install postcss-cli

This topic was automatically closed after 22 hours. New replies are no longer allowed.