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

mode: 'jit' with 2.1.0 causing issues. #293

Closed
crswll opened this issue Apr 5, 2021 · 6 comments
Closed

mode: 'jit' with 2.1.0 causing issues. #293

crswll opened this issue Apr 5, 2021 · 6 comments

Comments

@crswll
Copy link

crswll commented Apr 5, 2021

Hi!

When I use mode: 'jit' I get the following error in tailwindcss-intellisense output.

Found Tailwind config file: /Users/bcrisw467/www/project-name/tailwind.config.js
Found tailwindcss v2.1.0: /Users/bcrisw467/www/project-name/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.
Failed to initialise: TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received undefined
    at validateString (internal/validators.js:120:11)
    at Url.parse (url.js:159:3)
    at Object.urlParse [as parse] (url.js:154:13)
    at trackModified (/Users/bill/www/project-name/node_modules/tailwindcss/jit/lib/setupContext.js:230:24)
    at /Users/bill/www/project-name/node_modules/tailwindcss/jit/lib/setupContext.js:726:38
    at /Users/bill/www/project-name/node_modules/tailwindcss/jit/index.js:35:47
    at LazyResult.runOnRoot (/Users/bill/www/project-name/node_modules/postcss/lib/lazy-result.js:303:16)
    at LazyResult.runAsync (/Users/bill/www/project-name/node_modules/postcss/lib/lazy-result.js:355:26)
    at LazyResult.async (/Users/bill/www/project-name/node_modules/postcss/lib/lazy-result.js:205:30)
    at LazyResult.then (/Users/bill/www/project-name/node_modules/postcss/lib/lazy-result.js:190:17) {
  code: 'ERR_INVALID_ARG_TYPE'
@timothyjoelwright
Copy link

timothyjoelwright commented Apr 6, 2021

I'm also having this issue, although my output suggests a TypeError:

Found Tailwind config file: /Users/timothyjoelwright/Documents/Method.Foundation/web/tailwind.config.js
Found tailwindcss v2.1.1: /Users/timothyjoelwright/Documents/Method.Foundation/web/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.
Failed to initialise: TypeError: Cannot read property 'map' of undefined
    at /Users/timothyjoelwright/Documents/Method.Foundation/web/node_modules/tailwindcss/jit/lib/setupContext.js:783:9
    at /Users/timothyjoelwright/Documents/Method.Foundation/web/node_modules/tailwindcss/jit/index.js:35:47
    at LazyResult.runOnRoot (/Users/timothyjoelwright/Documents/Method.Foundation/web/node_modules/postcss/lib/lazy-result.js:303:16)
    at LazyResult.runAsync (/Users/timothyjoelwright/Documents/Method.Foundation/web/node_modules/postcss/lib/lazy-result.js:355:26)
    at LazyResult.async (/Users/timothyjoelwright/Documents/Method.Foundation/web/node_modules/postcss/lib/lazy-result.js:205:30)
    at LazyResult.then (/Users/timothyjoelwright/Documents/Method.Foundation/web/node_modules/postcss/lib/lazy-result.js:190:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

It initializes successfully when mode: jit is removed from tailwind.config.js

@crswll
Copy link
Author

crswll commented Apr 6, 2021

The error I mentioned was fixed. The one @timothyjoelwright mentioned is because mode: 'jit' isn't compatible yet but is being worked on from what I hear.

@crswll crswll changed the title mode: jit with 2.1.0 causing issues. mode: 'jit' with 2.1.0 causing issues. Apr 6, 2021
@gianmd
Copy link

gianmd commented Apr 6, 2021

do we have an ETA to make it work with the latest version and jit mode enabled?

@codemonkey800
Copy link

I got a workaround working by using an environment variable to determine the mode for the Tailwind config:

let mode;
if (process.env.TAILWIND_JIT) {
  mode = 'jit';
}

module.exports = {
  mode,
  // ...,
};

in your package.json, you can do something like:

{
  "scripts": {
    "dev": "TAILWIND_JIT=true next dev"
  }
}

Although, a proper solution would be great 😄

@crswll
Copy link
Author

crswll commented Apr 7, 2021

Brad mentioned a quick fix that basically makes it work like you're not using jit before it's done properly. I don't know when to expect it but sure it's on the radar.

@bradlc
Copy link
Contributor

bradlc commented Apr 7, 2021

This is fixed in v0.5.10 – note that this release does not include full support for the JIT engine. That is coming very soon though! 👀 For now the extension behaves as if you don't have JIT enabled.

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

5 participants