Skip to content

Unable to load project when using Yarn PnP on Windows in 0.14.* #1149

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

Closed
mjawhariPT opened this issue Jan 27, 2025 · 2 comments · Fixed by #1151
Closed

Unable to load project when using Yarn PnP on Windows in 0.14.* #1149

mjawhariPT opened this issue Jan 27, 2025 · 2 comments · Fixed by #1151
Assignees
Labels
bug Something isn't working Yarn PnP

Comments

@mjawhariPT
Copy link

What version of VS Code are you using?

v1.96.2

What version of Tailwind CSS IntelliSense are you using?

0.12.18, 0.14.0 / 0.14.1

What version of Tailwind CSS are you using?

v3.3.3

What package manager are you using?

yarn (v4.6.1, PnP)

What operating system are you using?

Windows

Tailwind config

import type { Config } from "tailwindcss";

import typography from "@tailwindcss/typography";
import reactAriaComponentsPlugin from "tailwindcss-react-aria-components";
import animatePlugin from "tailwindcss-animate";

export default {
    content: ["./src/**/*.{js,ts,jsx,tsx}"],
    theme: {
        screens: {
            xs: "320px",
            sm: "576px",
            md: "992px",
            lg: "1440px",
        },
        extend: {
            colors: {
                ...
            },
            fontFamily: {
                ...
            },
            keyframes: {
                ...
            },
            animation: {
                ...
            },
        },
    },
    future: {
        hoverOnlyWhenSupported: true,
    },
    plugins: [typography, reactAriaComponentsPlugin, animatePlugin],
} satisfies Config;

VS Code settings

{
    "editor.formatOnPaste": true,
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": "explicit",
        "source.fixAll.format": "explicit"
    },
    "eslint.nodePath": ".yarn/sdks",
    "files.associations": {
        "*.css": "tailwindcss"
    },
    "prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
    "search.exclude": {
        "**/.yarn": true,
        "**/.pnp.*": true
    },
    "typescript.tsdk": ".yarn/sdks/typescript/lib",
    "typescript.enablePromptUseWorkspaceTsdk": true,
    "tailwindCSS.experimental.classRegex": [
        ["([\"'`][^\"'`]*.*?[\"'`])", "[\"'`]([^\"'`]*).*?[\"'`]"]
    ]
}

Describe your issue

Hovering over classnames and auto-complete both work fine on v0.12.18. If I update to either of the 0.14 versions, neither work (as if the plugin is not enabled at all). This is the output for the plugin in case it helps:

Locating server…
Booting server...
Setting up server…
Listening for messages…
[Error - 2:20:05 PM] Failed to initialize workspace folder c:/Users/selja/Documents/website-new Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, node, and electron are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:249:11)
    at defaultLoad (node:internal/modules/esm/load:129:3)
    at ModuleLoader.load (node:internal/modules/esm/loader:555:13)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:434:56)
    at new ModuleJob (node:internal/modules/esm/module_job:71:27)
    at #createModuleJob (node:internal/modules/esm/loader:447:17)
    at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:259:34)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:17)
    at async ModuleLoader.import (node:internal/modules/esm/loader:472:23) {
  code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
[Info  - 2:22:14 PM] [GLOBAL] No matching project for document {
  fsPath: 'C:\\Users\\selja\\Documents\\website-new\\tailwind.config.ts',
  normalPath: '/c:/Users/selja/Documents/website-new/tailwind.config.ts'
}
[Info  - 2:22:14 PM] [GLOBAL] No matching project for document {
  fsPath: 'C:\\Users\\selja\\Documents\\website-new\\tailwind.config.ts',
  normalPath: '/c:/Users/selja/Documents/website-new/tailwind.config.ts'
}

The Info level errors show when I open any files, not just the config file. The Error only appears once.

@thecrypticace thecrypticace changed the title Extension breaks when upgrading from 0.12.18 to 0.14.* Unable to load project when using Yarn PnP in 0.14.* Jan 27, 2025
@thecrypticace
Copy link
Contributor

Ah, I think I know what the problem is! I missed a call to pathToFileURL when handling yarn PnP on Windows. Gonna try to get it fixed today/tomorrow. Thanks!

@thecrypticace thecrypticace self-assigned this Jan 27, 2025
@thecrypticace thecrypticace added the bug Something isn't working label Jan 27, 2025
@thecrypticace thecrypticace changed the title Unable to load project when using Yarn PnP in 0.14.* Unable to load project when using Yarn PnP on Windows in 0.14.* Jan 27, 2025
@thecrypticace
Copy link
Contributor

This should start working again once I tag 0.14.2 — aiming to do that today! Sorry about that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Yarn PnP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants