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

Issue with presets? #333

Closed
barnabasmolnar opened this issue May 20, 2021 · 5 comments
Closed

Issue with presets? #333

barnabasmolnar opened this issue May 20, 2021 · 5 comments

Comments

@barnabasmolnar
Copy link

Hey there,

First of all, great work on the extension Brad, love the effort and care that goes into tailwind tooling.

Lately, however, in some of my projects, the VSCode extension stopped working entirely.

Given a preset like this:

presets: [require('./node_modules/...path-to-tailwind-config.js...')]

the extension does not seem to work at all for the entire project. Please note that I have JIT mode enabled in the config that resides in node_modules. Tailwind and the JIT mode themselves work perfectly without issues, it's just that the extension probably can't pick up the preset config from gitignored folders?

Output from the extension:

Found Tailwind CSS config file: ...path/tailwind.config.js
Loaded postcss v8.2.15: ...path/node_modules/postcss
Loaded tailwindcss v2.1.2: ...path/node_modules/tailwindcss

warn - You have enabled the JIT engine which is currently in preview.
warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.
@bradlc
Copy link
Contributor

bradlc commented May 20, 2021

Hey @barnabasmolnar. Are you able to share the preset?

@barnabasmolnar
Copy link
Author

Sure, here it goes:

module.exports = {
  mode: 'jit',
  prefix: 'bmspt-',
  darkMode: 'media',
  purge: [
    './src/**/*.html',
    './src/**/*.js',
    './src/**/*.jsx',
    './src/**/*.ts',
    './src/**/*.tsx',
  ],
  theme: {
    extend: {
      fontSize: {
        '2xs': '0.625rem',
      },
      zIndex: {
        1: 1,
      },
    },
  },
  variants: {
    extend: {},
  },
  plugins: [
    require('@tailwindcss/forms'),
    require('@tailwindcss/typography'),
    require('@tailwindcss/aspect-ratio'),
  ],
};

@bradlc bradlc closed this as completed in 988e85c May 20, 2021
@bradlc
Copy link
Contributor

bradlc commented May 20, 2021

Thank you! This should be fixed in v0.6.6 👍

@barnabasmolnar
Copy link
Author

Awesome, cheers Brad!

@JeffBeltran
Copy link

I ran into the same issue but im referencing a subpath. Everything works as expected in tailwind.

  presets: [require("@homevalet/bowtie/config")],
  mode: "jit",
  purge: [
    "./index.html",
    "./src/**/*.{vue,js,ts,jsx,tsx}",
    "./node_modules/@homevalet/bowtie/**/*",
  ],

but the extension throws the following error

[Error - 3:04:52 PM] Tailwind CSS: Can't resolve '@homevalet/bowtie/config' in '/Users/jeffbeltran/code/vite-project'
Error: Can't resolve '@homevalet/bowtie/config' in '/Users/jeffbeltran/code/vite-project'
    at c (/Users/jeffbeltran/.vscode/extensions/bradlc.vscode-tailwindcss-0.6.14/dist/server/tailwindServer.js:2:26552)
    at /Users/jeffbeltran/.vscode/extensions/bradlc.vscode-tailwindcss-0.6.14/dist/server/tailwindServer.js:2:27239
    at /Users/jeffbeltran/.vscode/extensions/bradlc.vscode-tailwindcss-0.6.14/dist/server/tailwindServer.js:2:27803
    at eval (eval at create (/Users/jeffbeltran/.vscode/extensions/bradlc.vscode-tailwindcss-0.6.14/dist/server/tailwindServer.js:50:32334), <anonymous>:15:1)
    at /Users/jeffbeltran/.vscode/extensions/bradlc.vscode-tailwindcss-0.6.14/dist/server/tailwindServer.js:2:27803
    at eval (eval at create (/Users/jeffbeltran/.vscode/extensions/bradlc.vscode-tailwindcss-0.6.14/dist/server/tailwindServer.js:50:32334), <anonymous>:27:1)
    at /Users/jeffbeltran/.vscode/extensions/bradlc.vscode-tailwindcss-0.6.14/dist/server/tailwindServer.js:2:13662
    at /Users/jeffbeltran/.vscode/extensions/bradlc.vscode-tailwindcss-0.6.14/dist/server/tailwindServer.js:2:27803
    at eval (eval at create (/Users/jeffbeltran/.vscode/extensions/bradlc.vscode-tailwindcss-0.6.14/dist/server/tailwindServer.js:50:32334), <anonymous>:15:1)
    at /Users/jeffbeltran/.vscode/extensions/bradlc.vscode-tailwindcss-0.6.14/dist/server/tailwindServer.js:2:27803

this could 100% be on me with how i published the module, but at this point this is the only thing not working.

if it helps, i can fix the issue with the above error by directly referencing the module via

 presets: [require("./node_modules/@homevalet/bowtie/dist/config")],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants