Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tailwind 3.3.2 - module is not defined

I am stuck on a tutorial which is incorporating Tailwind, which in this case is tailwind 3.3.2.

Per the tutorial, I am supposed to open a file called tailwind.config.js and paste the below code from https://tailwindcss.com/docs/installation:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    extend: {},
  },
  plugins: [],
}

I immediately get the red squiggly line under "module", with an error that reads as follows:

enter image description here

What did I do wrong? The tutorial did not encounter this error.

like image 737
John Beasley Avatar asked Mar 20 '26 14:03

John Beasley


2 Answers

Seems like the code itself is correct. The message you are seeing in your IDE seems to be coming from ESLint, with regards to the no-undef rule. To resolve the error, consider letting ESLint know that this file is meant to be used in the environment of Node.js by adding /*eslint-env node*/ as per the the documentation.

like image 132
Wongjn Avatar answered Mar 23 '26 04:03

Wongjn


Assuming you haven't figured it out, convert module.exports to export default. That's should fix your issue

like image 40
Victor Ike Avatar answered Mar 23 '26 03:03

Victor Ike



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!