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

Doesn't work with async plugins e.g. TailwindCSS #1

Open
ghost opened this issue Sep 23, 2019 · 1 comment
Open

Doesn't work with async plugins e.g. TailwindCSS #1

ghost opened this issue Sep 23, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request vendor Can't be worked on before release of new features in dependency packages.

Comments

@ghost
Copy link

ghost commented Sep 23, 2019

How to repro
  1. Create the two files:

.babelrc

{
  "plugins": [
    ["postcss-template-literals", {
      "plugins": [
        "tailwindcss"
      ]
    }]
  ]
}

tailwind-styles.js

import { css } from 'lit-element';

export const TailwindStyles = css`
  @tailwind base;
  @tailwind components;
  @tailwind utilities;
`;
  1. Install deps: npm i --save-dev @babel/cli babel-plugin-postcss-template-literals tailwindcss
  2. Execute: npx babel ./tailwind-styles.js
Stacktrace
Error: Use process(css).then(cb) to work with async plugins
    at LazyResult.sync (/mnt/c/Users/domen/Documents/Developer/web/mydiscs.com/node_modules/postcss/lib/lazy-result.js:284:15)
    at LazyResult.stringify (/mnt/c/Users/domen/Documents/Developer/web/mydiscs.com/node_modules/postcss/lib/lazy-result.js:305:10)
    at LazyResult.get (/mnt/c/Users/domen/Documents/Developer/web/mydiscs.com/node_modules/postcss/lib/lazy-result.js:350:19)
    at PluginPass.TaggedTemplateExpression (/mnt/c/Users/domen/Documents/Developer/web/mydiscs.com/node_modules/babel-plugin-postcss-template-literals/index.js:37:67)
    at newFn (/mnt/c/Users/domen/Documents/Developer/web/mydiscs.com/node_modules/@babel/core/node_modules/@babel/traverse/lib/visitors.js:193:21)
    at NodePath._call (/mnt/c/Users/domen/Documents/Developer/web/mydiscs.com/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/mnt/c/Users/domen/Documents/Developer/web/mydiscs.com/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/mnt/c/Users/domen/Documents/Developer/web/mydiscs.com/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/mnt/c/Users/domen/Documents/Developer/web/mydiscs.com/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitSingle (/mnt/c/Users/domen/Documents/Developer/web/mydiscs.com/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:90:19)
@art-bazhin art-bazhin self-assigned this Sep 23, 2019
@art-bazhin
Copy link
Owner

Unfortunately Babel doesn't support async plugins yet.
babel/babel#9888

@art-bazhin art-bazhin added enhancement New feature or request vendor Can't be worked on before release of new features in dependency packages. labels Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vendor Can't be worked on before release of new features in dependency packages.
Projects
None yet
Development

No branches or pull requests

1 participant