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

Error: true is not a PostCSS plugin #17236

Closed
DopamineDriven opened this issue Sep 20, 2020 · 20 comments
Closed

Error: true is not a PostCSS plugin #17236

DopamineDriven opened this issue Sep 20, 2020 · 20 comments

Comments

@DopamineDriven
Copy link

DopamineDriven commented Sep 20, 2020

True is not a PostCSS plugin

Describe the bug

When running yarn dev it returns the following error:

error - ./styles/index.css (./node_modules/next/node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/next/dist/compiled/postcss-loader??__nextjs_postcss!./styles/index.css)
Error: true is not a PostCSS plugin

I have tried using .json instead of .js, that did not resolve the issue. I am using typescript and this is a new bug. I have had the same configuration for tailwind.config.js and postcss.config.js in the root of my projects for months with no prior issues. I even eliminated all content from styles/index.css with the exception of the following:

@tailwind base;

@tailwind components;

@tailwind utilities;

To Reproduce

Install the following:

yarn add tailwindcss next@9.5.4-canary.20 react react-dom && yarn add -D postcss-preset-env autoprefixer @types/react @types/react-dom @types/node postcss-flexbugs-fixes stylelint stylelint-config-recommended typescript

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to 'https://github.com/DopamineDriven/windy-city-next'
  2. Click on 'clone repository or download zip'
  3. 'install dependencies'
  4. run yarn dev and the error will flag

Expected behavior

I expect it to run just as all of my other TS+Nextjs+Tailwindcss repos do, each using next 9.5.x (headless-wp-next-directory, asross-portfolio)

Screenshots

image

System information

  • OS: Windows
  • Browser (if applies): Brave, Chrome
  • Version of Next.js: 9.5.4-canary.20
  • Version of Node.js: 14.11.0

Add any other context about the problem here.

@DopamineDriven
Copy link
Author

Update: Determined the issue

autoprefixer@10.0.0 breaks next's postcss loader on start

I rolled back to autoprefixer@9.8.6 and the issue was resolved

@stephanschubert
Copy link

Maybe related: webpack-contrib/postcss-loader#482

@ai
Copy link

ai commented Sep 20, 2020

To fix this issue Next.js need to update PostCSS 7 to 8

@ai ai mentioned this issue Sep 20, 2020
@ai
Copy link

ai commented Sep 20, 2020

I created a separated issue about updating to PostCSS 8 #17242

@timneutkens
Copy link
Member

Closing as duplicate of #17242

@alexventuraio
Copy link

What @DopamineDriven mentioned about downgrading is correct and it fixed the issue on my end!

abhishekbhardwaj added a commit to abhishekbhardwaj/tailwind-react-next.js-typescript-eslint-jest-starter that referenced this issue Sep 24, 2020
@DmitryOlkhovoi
Copy link

I have the same problem with postcss-nested

@laurivaananen
Copy link

@DmitryOlkhovoi I had the same issue and managed to fix it by downgrading the package to postcss-nested@4.2.3

@DmitryOlkhovoi
Copy link

@laurivaananen yes, that works :)

@AWIXOR-zz
Copy link

Update: Determined the issue

autoprefixer@10.0.0 breaks next's postcss loader on start

I rolled back to autoprefixer@9.8.6 and the issue was resolved

This worked for me too!

@dr5hn
Copy link

dr5hn commented Oct 5, 2020

UPDATE: I solved this issue by adding this to package.json 🎉

    "peerDependencies": {
        "postcss": "^8.0.0"
    },

SOURCE: https://github.com/postcss/autoprefixer/releases/tag/10.0.0

@cascharly
Copy link

Thank you very much!!!!

@pedoch
Copy link

pedoch commented Oct 11, 2020

Thank you so much

znicholasbrown added a commit to PrefectHQ/ui that referenced this issue Oct 12, 2020
* Update package lock

* Downgrade autoprefix (has a postcss-related bug documented here: vercel/next.js#17236)

* Remove v-slot references, replace with #, disable valid-v-slot

* Turn valid-v-slot off

* Downgrade d3-dag - the upgrade path will be tricky and so should be handled in a separate PR

* Fix v-slot ref in cloud hooks component

* Move beforeRouteLeave above data per updated style guide

* PasalCase apex chart component

* PascaleCase transition height component, upgrade sass-loader 2(!) major versions
znicholasbrown added a commit to PrefectHQ/ui that referenced this issue Oct 22, 2020
* Filter map indexes > -1

* Increase poll interval 1000 => 2000

* Add mapped children query

* Update apollo flow run handler for _by_pk route

* Update package lock

* Downgrade autoprefix (has a postcss-related bug documented here: vercel/next.js#17236)

* Remove v-slot references, replace with #, disable valid-v-slot

* Turn valid-v-slot off

* Downgrade d3-dag - the upgrade path will be tricky and so should be handled in a separate PR

* Fix v-slot ref in cloud hooks component

* Move beforeRouteLeave above data per updated style guide

* PasalCase apex chart component

* PascaleCase transition height component, upgrade sass-loader 2(!) major versions

* Mapped schematic nodes should use mapped children route

* Improve legibility of task run names on task run table

* Remove some unused nested queries

* Remove unused variables in flowrun query

* Limit the width of the expected runs tooltip and conver it to localestring

* Check if n_map_states exists before converting

* Sort task run heartbeat query by state_timestamp so prevent reordering

* Remove join from parent task run query

* Add upstream/downstream edges to task run query, update upstream/downstream count on depdencies tile (tile still broken)

* Update the task run dependencies to look for mapped task runs

* Make sure task run fields can be unique

* Fix issue with duplicate node ids

* Make sure task run id is included in tasks

* Make sure the currently selected task run can always show mapped children if they exist

* Add task run names to schematic nodes and previews

* Remove console log

* Convert n_map_states to locale string on task run details tile

* Remove unused reactive props on the task run page, add map handlers

* Remove the entire row for task results if not configured

* Add children and siblings tabs

* Update mapped sibling/child checks

* Hide tabs

* Add mobile tabes for mapped tabs

* Add mapped task runs tile

* Update name of the tab and remove children/parent tabs

* Add table search field

* Searching for runs by name or map index works

* Start the mapped runs table on the page of the currently-viewed run

* Remove console logs and fix issue with negative offsets

* Update changelog

* Remove default segmants comment

* Use optional chaining in skip query

* Use optional chaining to test for result

* Remove duplicate map indices

* Add new query for the gantt chart

* Add some state chips to the dynamic preview

* Make text bold

* Add a new label to the mapped runs tab
ndrsllwngr added a commit to ndrsllwngr/andreasellwanger.com that referenced this issue Oct 23, 2020
Note
- PostCSS 8 issues (do not yet upgrade autoprefixer, postcss-x dependencies to next major version)
- Error: true is not a PostCSS plugin vercel/next.js#17236
@giraffesyo
Copy link
Contributor

For me I had to downgrade postcss-flexbugs-fixes from 5.0.0 to 4.2.1. I did this in the package.json by changing to:
"postcss-flexbugs-fixes": "4.2.1", and rerunning yarn.

znicholasbrown added a commit to PrefectHQ/ui that referenced this issue Nov 12, 2020
* Update tile to allow multiple color states and to use mapped children route

* Add new components for the timeline chart

* Improve the resize chart listener

* Add a running timer

* Add d3fc

* Add d3fc axisbottom

* Add explicit nullish coalescing plugin

* Improve zoom/panning to be more consistent

* Remove d3fc package - its documentation is poor, its wrapper methods are confusing, examples aren't verbose, and its axis is lagging with direct comparison to d3.axis

* Remove commented props

* More axis styling and better svg height

* Basic rounding, scaffold new staging idea

* Use arc instead of rect for min width tasks

* Those scaled shapes are unintentional, promise

* Draw caps and fix scaling

* Improve bar radius decision making, add some more tools

* Fix issue with bad circle offset

* Remove circle offset in favor of radius

* Use an adjusted x value for bar calculations

* Remove erroneous url inclusion

* Add labels

* Fix issues with text hanging variance

* Don't show labels when timeline is collapsed

* Add transitions to collapsing

* Use better domain padding

* Translate extent 0.3 => 0.1

* Add basic breakpoints for scheduled, submitted, running, and finished

* Color breakpoints based on state

* Fix some intra-bar mapped states, add flow run state to the end breakpoint

* Fix issue where mapped runs didn't have the correct offset for the final chunk

* Store canvas path refs ahead of time

* Remove small rendering blips

* Poll for mapped runs and task runs

* Add a watcher to the items

* Update lab el positioning (raise)

* Use 5% start end padding instead of 60 seconds

* Pass a live prop to timeline

* Make live graphs more consistent

* Break the _rawRender method into two methods for better control

* Improve live updating

* Remove console log

* Keep axis in sync with user actions

* Use the render method as the timing callback for efficiency

* Improve right-side calculation

* Improve breakline transitions

* Tasks without start times should be moved to the right

* Animate breakpoints from the now node

* Make sure caps don't overflow width

* Don't use computed prop for breakpoints in timeline tile

* Make sure breakpoints are updated on mount as well

* Update breakpoint path in join

* Don't allow translateExtent to extend past width

* Don't create a different shape for small bars, join the caps together isntead

* Remove rounding from x and width calcs for smoother animation

* Use the min and max timestamps for a given run

* Improve play/pause functionality

* Hide breakpoint labels when collapsed

* Add a shadow for running tasks

* Sort mapped runs

* Improve mapped task run visibility

* Use serialized states when possible

* Calculate height, hide controls

* Enforce a min height on the tile

* Rename the flow page timeline tile

* Rename dashboard timeline tile to flow run history tile

* Update tab transitions for flow run page

* Rename gantt => timeline

* Remove unused templates

* Allow tabs to break max width

* Use auto for max widths, constrain timeline tile

* Reorder some data props

* Enforce min bar radius with scroll overflow

* Add some x padding to allow scrolling and zooming

* Enforce better min radius

* Add basic interaction handlers

* Redraw canvas on hover

* Add mouse out handler

* Remove shadow from non-hovered bars

* Fix shadow compression

* Remove console log

* Move x out of the loop

* Fix canvas offcenter

* Change cursor on hover

* Don't emit events, add event handler on timeline tile

* Add labels again

* Enforce a max bar radius

* Make sure labels are always visible on visible bars

* Add new component for hover interactions

* Update specs and mocks

* Absolutely position task run menu

* Filter map indexes > -1

* Increase poll interval 1000 => 2000

* Add mapped children query

* Update apollo flow run handler for _by_pk route

* Update package lock

* Downgrade autoprefix (has a postcss-related bug documented here: vercel/next.js#17236)

* Remove v-slot references, replace with #, disable valid-v-slot

* Turn valid-v-slot off

* Downgrade d3-dag - the upgrade path will be tricky and so should be handled in a separate PR

* Fix v-slot ref in cloud hooks component

* Move beforeRouteLeave above data per updated style guide

* PasalCase apex chart component

* PascaleCase transition height component, upgrade sass-loader 2(!) major versions

* Mapped schematic nodes should use mapped children route

* Improve legibility of task run names on task run table

* Remove some unused nested queries

* Remove unused variables in flowrun query

* Limit the width of the expected runs tooltip and conver it to localestring

* Check if n_map_states exists before converting

* Sort task run heartbeat query by state_timestamp so prevent reordering

* Remove join from parent task run query

* Add upstream/downstream edges to task run query, update upstream/downstream count on depdencies tile (tile still broken)

* Update the task run dependencies to look for mapped task runs

* Make sure task run fields can be unique

* Fix issue with duplicate node ids

* Make sure task run id is included in tasks

* Make sure the currently selected task run can always show mapped children if they exist

* Add task run names to schematic nodes and previews

* Remove console log

* Convert n_map_states to locale string on task run details tile

* Remove unused reactive props on the task run page, add map handlers

* Remove the entire row for task results if not configured

* Add children and siblings tabs

* Update mapped sibling/child checks

* Hide tabs

* Add mobile tabes for mapped tabs

* Add mapped task runs tile

* Update name of the tab and remove children/parent tabs

* Add table search field

* Searching for runs by name or map index works

* Start the mapped runs table on the page of the currently-viewed run

* Remove console logs and fix issue with negative offsets

* Update changelog

* Add states back to the flow run query

* Update references to timelinemixin => flowRunHistoryMixin

* Sort items based on start time

* Fix bad refs to flow run, use state timestamp as start/end time

* Fix state timetsamp ref

* Don't enforce a min height on the timeline tile container

* Remove default segmants comment

* Use optional chaining in skip query

* Use optional chaining to test for result

* Remove duplicate map indices

* Messy, but optional parallelization is working

* Stop removing states join from the flow run query you nincompoop

* Fix bad refs to task runs

* Breakpoint labels should be on top of the chart

* Improve the x axis (just draw a line), fix padding

* Things are mostly working, remove shadows

* Add tooltip logic

* Use svg height instead of canvas height

* Expand the tooltip a bit

* More clarification around tooltips, add a new method to the formatTimeMixin for fractional seconds

* Make the timeline tile more robust to restarted flows

* Add todo

* Add hover breakpoint

* Lower the default max bar radius

* Move controls to menu

* Update timeline tile styling

* Remove some unused styles

* Improve styling of the x-axis

* xScale should start at left padding

* Update breakline stroke dasharray

* Tighten breakline animations

* FINALLY - fixed issues with bad x scaling with runs with small durations

* Calculate row intersection based on a 1 second buffer

* Remove constant bar padding offset

* Display all state transitions

* Don't show timeline until task runs have loaded

* Change color of breaklines and add handles - calculate right bookend on all flow run states as well

* Make sure scales are updated when breakpoints change (useful in cases of manually set states)

* Make sure task runs that are still running have their end times correctly reflect that

* Collapse breaklines into groups

* Allow for slots on the timeline component, add 2 types of tooltips

* Fix positioning on task run tooltip

* Update breakpoint padding, fix tooltip styling and positioning

* Fix y-orientation

* Remove svg and canvas element transitions

* Make sure mapped task run durations match up with the state of the flow run

* Add more context to tooltips for mapped task runs

* Increase task run tooltip y padding

* Improve definition of overlap

* Improve live rendering and the first render on a live timeline

* Fix controls positioning, improve x axis performance

* Improve breakpoint transitions

* Move bars to bottom of bandwidth slot

* Add occlusion to bars

* Allow passing multiple task run ids to event handlers

* Remove console log

* Revert maxbar size

* Remove timeline tab

* Don't allow user selection of x-axis

* Solidify y translation extent, fix left and right panning extent calculation on disabled

* Hide debugging controls

* Add control box styling

* Attach event handlers to control panel

* Add ability to hide controls

* Truncate task run tooltip

* Increase padding between bars

* Add a new "scheduled start" breakpioint

* use start_time as end_if is_finished

* Add a flow run state mapping to the min start time calculation

* Remove console log

* Add a comment and placeholder click event handler

* Fix scheduled and filter pending flow run states, add expected runs to all mapepd task run tooltisp

* Fix Unknown expected mapped task runs

* Revert duration behavior for mapped pipelines on older versions of Core

* Make sure hovered items are properly cleared when going high => low

* Make sure time axis reflects user-selected timezone

* Update changelog

* Update package-lock

* Fix package json merge conflict
@kirincc
Copy link

kirincc commented Nov 14, 2020

Update: Determined the issue

autoprefixer@10.0.0 breaks next's postcss loader on start

I rolled back to autoprefixer@9.8.6 and the issue was resolved

In my case, I not only rolled back to autoprefixer@9.8.6 but also downgrading the package to postcss-nested@4.2.3, and the issue was solved.

@sfmskywalker
Copy link

Following TailwindCSS' guide fixed the issue for me: https://tailwindcss.com/docs/installation#post-css-7-compatibility-build

@lu-zen
Copy link

lu-zen commented Nov 29, 2020

For me I had to downgrade postcss-flexbugs-fixes from 5.0.0 to 4.2.1. I did this in the package.json by changing to:
"postcss-flexbugs-fixes": "4.2.1", and rerunning yarn.

If you're using tailwindcss@2 there's no need to keep this module, tw2 dropped IE support anyways

@sebmellen
Copy link

sebmellen commented Jan 5, 2021

@sfmskywalker Thank you! That finally fixed the issue for me.

Does anyone have an idea when we might be able to move off the compatibility build?

From the TailwindCSS link:

Once the rest of your tools have added support for PostCSS 8, you can move off of the compatibility build by re-installing Tailwind and its peer-dependencies using the latest tag:
npm uninstall tailwindcss @tailwindcss/postcss7-compat
npm install tailwindcss@latest postcss@latest autoprefixer@latest

critocrito added a commit to rankingdigitalrights/index2020 that referenced this issue Jan 15, 2021
Base on our current version of TailwindCSS and NextJS we are still on an
older version of PostCSS. The new postcss-import plugin relies on
PostCSS v8 but we need to stay compatible with v7. Therefore, we are
installing postcss-import v12 and not the newer v14.

Both packages should be updated to later version and the postcss-import
plugin shold be updated as well.

https://tailwindcss.com/docs/installation#post-css-7-compatibility-build
vercel/next.js#17236
@dannysofftie
Copy link

Adding postcss as a devDependency solved the issue for me. Version 8.3.0

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests