Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

290
Views
Using an ES module in TailwindCSS config (Using React and Craco)

I've been trying for hours to import the package d3-colors into my tailwind.config.js. No solutions I have found on the internet have worked so far.

I have tried:

  • Converting it to tailwind.config.mjs, but then it doesn't get loaded. The configuration does not work.

  • Using the await import('colors-d3') but that doesn't work either because then I have to await the function that gets it, and that's not allowed either:

module.exports = await config();
SyntaxError: await is only valid in async functions and the top level bodies of modules
  • I've tried changing the package to type='module', but then I have all sorts of issues with Craco not being able to load it's config once I convert it to an ESM module because craco itself is commonjs.

  • I have tried modifying Craco's config...

  • I've tried using a postcss config file to pass the tailwind.config.mjs as the config file parameter, doesn't work either.

etc etc

I can't get it to work. How can I just import this module into my tailwind config?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

According to the team, they won't be supporting ESM anytime soon.

https://github.com/tailwindlabs/tailwindcss/issues/8029#issuecomment-1086875656

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!