roots / sage

WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow
https://roots.io/sage/
MIT License
12.77k stars 3.06k forks source link

Bug: bud dev won't work, but bud build does #3109

Closed kjvdven closed 1 year ago

kjvdven commented 1 year ago

Terms

Description

What's wrong?

When I run yarn dev, the development server never boots. This only happens when I have a custom Tailwind config file. When I run yarn build, the theme is build with no errors.

What have you tried?

  1. Creating a separate theme and enabling step-by-step where the issue starts.
  2. Changing the node version
  3. Updating bud to a newer version
  4. Checking an older project if that still works (it does)
  5. Removing cashing
  6. Removing node modules

What insights have you gained?

It only happens when I have a custom tailwind config file. I can still use build. The same Tailwind config file I use, does work in a storybook project.

Possible solutions

??

Temporary workarounds

Only use yarn build

Steps To Reproduce

  1. Create a new theme

  2. Install some packages

    {
    "name": "sage",
    "private": true,
    "browserslist": [
    "extends @roots/browserslist-config/current"
    ],
    "engines": {
    "node": ">=16.0.0"
    },
    "scripts": {
    "dev": "bud dev",
    "start": "bud dev",
    "build": "bud build",
    "translate": "yarn translate:pot && yarn translate:update",
    "translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --include=\"app,resources\"",
    "translate:update": "for filename in ./resources/lang/*.po; do msgmerge -U $filename ./resources/lang/sage.pot; done; rm -f ./resources/lang/*.po~",
    "translate:compile": "yarn translate:mo && yarn translate:js",
    "translate:js": "wp i18n make-json ./resources/lang --pretty-print",
    "translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
    },
    "devDependencies": {
    "@roots/bud": "6.4.5",
    "@roots/bud-eslint": "6.4.5",
    "@roots/bud-sass": "6.4.5",
    "@roots/bud-stylelint": "6.4.5",
    "@roots/bud-tailwindcss": "6.4.5",
    "@roots/sage": "6.4.5",
    "eslint-config-airbnb-base": "^15.0.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-import": "^2.26.0",
    "stylelint-config-prettier-scss": "^0.0.1",
    "stylelint-config-sass-guidelines": "^9.0.1"
    },
    "dependencies": {
    "@alpinejs/collapse": "^3.10.5",
    "@alpinejs/focus": "^3.10.5",
    "@alpinejs/ui": "3.10.5-beta.8",
    "alpinejs": "^3.10.5"
    }
    }
  3. Configure tailwind

// https://tailwindcss.com/docs/configuration
module.exports = {
  content: ["./index.php", "./app/**/*.php", "./resources/**/*.{php,vue,js}"],
  theme: {
    colors: {
      transparent: "transparent",
      current: "currentColor",
      white: "#ffffff",
      black: "#000",
      blue: {
        100: "#e2f2fa",
        300: "#c4e5f4",
        500: "#009fe3",
        800: "#07074c",
      },
      red: {
        100: "#f9e7e7",
        500: "#c60f0f",
        700: "#9a0000",
      },
      grey: {
        500: "#4a585b",
      },
    },
    fontSize: {
      xs: "0.875rem",
      sm: "1rem",
      base: "1.125rem",
      lg: "1.5rem",
      xl: "1.75rem",
      "clamp-xs": "clamp(0.875rem, 0.8103rem + 0.2759vw, 1rem)", // 14 tot 16
      "clamp-sm": "clamp(1rem, 0.9353rem + 0.2759vw, 1.125rem)", // 16 tot 18
      "clamp-base": "clamp(1.125rem, 1.0603rem + 0.2759vw, 1.25rem)", // 18 tot 20
      "clamp-lg": "clamp(1.125rem, 1.0603rem + 0.2759vw, 1.25rem)", // 18 tot 20
      "clamp-xl": "clamp(1.25rem, 1.1207rem + 0.5517vw, 1.5rem)", // 20 tot 24
      "clamp-2xl": "clamp(1.75rem, 1.6207rem + 0.5517vw, 2rem)", // 28 tot 32
      "clamp-3xl": "clamp(2.875rem, 2.2931rem + 2.4828vw, 4rem)", // 46 tot 64
    },
    extend: {
      fontFamily: {
        sans: ["TT Commons"],
      },
      gridTemplateColumns: {
        cards: "repeat(auto-fill, minmax(20rem, 1fr))",
      },
      aspectRatio: {
        card: "10 / 9",
      },
    },
  },
  plugins: [],
};

Expected Behavior

Actual Behavior

Nothing, it hangs. If I make a deliberate error in the Tailwind config, it does show up.

-- default image

-- verbose image

Relevant Log Output

No response

Versions

10.3.1

retlehs commented 1 year ago

@kjvdven Sorry about the trouble! There's a couple recent Bud releases with some dev server issues, but 6.6.2 should be okay to use. We're working on getting a new release out without the dev server issues later today.

Ref https://github.com/roots/bud/issues/1914

kjvdven commented 1 year ago

I get the feeling they are not related, I'm on an older bud version, this version I have working on another project. Also I tried that version without succes.

retlehs commented 1 year ago

In that case, let’s get a minimal reproduction created and report an issue on the Bud repo