bud icon indicating copy to clipboard operation
bud copied to clipboard

[bug] watch/build doesn't work after update.

Open RomkaLTU opened this issue 1 year ago • 12 comments

Agreement

Describe the issue

watch/build doesn't work after updating to latest version. the

Expected Behavior

watch/build compiling and staring dev server.

Actual Behavior

Just stuck

CleanShot 2022-09-21 at 20 06 09

Steps To Reproduce

  1. run yarn build

version

6.4.1

What package manager are you using?

yarn

version

1.22.19

Logs

No response

Configuration

// @ts-check

/**
 * Build configuration
 *
 * @see {@link https://bud.js.org/guides/getting-started/configure}
 * @param {import('@roots/bud').Bud} app
 */
export default async (app) => {
  app
    /**
     * Application entrypoints
     */
    .entry({
      app: ["@scripts/app", "@styles/app"],
      editor: ["@scripts/editor", "@styles/editor"],
    })

    /**
     * Directory contents to be included in the compilation
     */
    .assets(["images", "fonts", "theme"])

    /**
     * Matched files trigger a page reload when modified
     */
    .watch(["resources/views/**/*", "app/**/*"])

    /**
     * Proxy origin (`WP_HOME`)
     */
    .proxy("https://foo.test")

    /**
     * Development origin
     */
    .serve("http://foo.test:3000")

    /**
     * URI of the `public` directory
     */
    .setPublicPath("/app/themes/codesome/public/");
};

Relevant .budfiles

No response

RomkaLTU avatar Sep 21 '22 17:09 RomkaLTU

  • what is the output of yarn bud doctor?
  • what about verbose logging yarn bud build -vvvv? don't need the full output; just looking for any extra information.
  • what are your project dependencies/devDependencies?

kellymears avatar Sep 21 '22 17:09 kellymears

Everything yarn bud * related refuses to run, it's hanging to be clear, I have a node process wich uses 100% CPU. Tried to delete node_modules ant lock.

"devDependencies": {
    "@roots/bud": "6.4.1",
    "@roots/bud-tailwindcss": "6.4.1",
    "@roots/sage": "6.4.1",
    "hamburgers": "^1.2.1",
    "swiper": "^8.4.2"
  },
  "dependencies": {
    "@tailwindcss/forms": "^0.5.3",
    "@tailwindcss/typography": "^0.5.7",
    "postcss": "^8.4.16"
  }

RomkaLTU avatar Sep 21 '22 17:09 RomkaLTU

node -v?

kellymears avatar Sep 21 '22 17:09 kellymears

Node v16.17.0

also tried with v16.16

Everything working with bud version 6.3.5

RomkaLTU avatar Sep 21 '22 17:09 RomkaLTU

Just tried with NPM, and it seems working with some warnings:

CleanShot 2022-09-21 at 20 45 06

RomkaLTU avatar Sep 21 '22 17:09 RomkaLTU

However resolving that warning and trying to yarn build resulted in same problem, yarn stuck and node consuming 100% CPU.

RomkaLTU avatar Sep 21 '22 17:09 RomkaLTU

So the workaround currently is to use NPM instead of yarn or downgrade to bud v 6.3.5

RomkaLTU avatar Sep 21 '22 17:09 RomkaLTU

with npm can you:

  1. run bud build --debug
  2. open .budfiles/sage/webpack.config.dump
  3. search for postcss and post the matching rule

the object should look something like this:

Object {
  "ident": "postcss",
  "loader": "[rootPath]/node_modules/postcss-loader/dist/cjs.js",
  "options": Object {
    "postcssOptions": Object {
      "plugins": Array [
        "[rootPath]/node_modules/postcss-import/index.js",
        "[rootPath]/node_modules/tailwindcss/nesting/index.js",
        "[rootPath]/node_modules/tailwindcss/lib/index.js",
        Array [
          "[rootPath]/node_modules/postcss-preset-env/dist/index.cjs",
          Object {
            "features": Object {
              "focus-within-pseudo-class": false,
            },
            "stage": 1,
          },
        ],
      ],
    },
    "sourceMap": true,
  },
}

kellymears avatar Sep 21 '22 17:09 kellymears

Object {
                "ident": "postcss",
                "loader": "/Users/rd/Sites/xxx/web/app/themes/codesome/node_modules/postcss-loader/dist/cjs.js",
                "options": Object {
                  "postcssOptions": Object {
                    "plugins": Array [
                      "/Users/rd/Sites/xxx/web/app/themes/codesome/node_modules/postcss-import/index.js",
                      "/Users/rd/Sites/xxx/web/app/themes/codesome/node_modules/tailwindcss/nesting/index.js",
                      "/Users/rd/Sites/xxx/web/app/themes/codesome/node_modules/tailwindcss/lib/index.js",
                      Array [
                        "/Users/rd/Sites/xxx/web/app/themes/codesome/node_modules/postcss-preset-env/dist/index.cjs",
                        Object {
                          "features": Object {
                            "focus-within-pseudo-class": false,
                          },
                          "stage": 1,
                        },
                      ],
                    ],
                  },
                  "sourceMap": true,
                },
              },

RomkaLTU avatar Sep 21 '22 18:09 RomkaLTU

seems correct.

the --log flag might give more insight with npm, as well. we might be blocked on this unless you can do a minimal reproduction.

kellymears avatar Sep 21 '22 18:09 kellymears

Confirming that bud is no longer building with pnpm either. After a fresh removal of lockfiles and node_modules and with auto-install-peers=true, the node_modules directory has none of the necessary bud dependencies (@roots/bud-terser, @roots/bud-plugin-wordpress, etc). The build process fails to import from those dependencies, and won't build.

evankford avatar Sep 22 '22 14:09 evankford

I finally experienced it (after god knows how many builds in CI..).

I believe I have fixed it as part of #1697.

Specifically the removal of this logger call:

https://github.com/roots/bud/pull/1697/files#diff-a9ad3e31d1118714865b8bd0a1ded58e346e0c94c77e858acdcbbc55f8d70820L130-L133

I have no idea why but this directly follows the logger ready success message, and the removal of it fixed it for me.

kellymears avatar Sep 23 '22 01:09 kellymears

This should be fixed in v6.4.2 by https://github.com/roots/bud/commit/a5dfd7aa48257e2ac5ebad91584a850632ac5721.

Please feel free to reopen this issue if you are still having problems. It is a hard issue to reliably reproduce so I can't be absolutely certain I fixed it.

kellymears avatar Sep 23 '22 17:09 kellymears

Confirming that bud is no longer building with pnpm either. After a fresh removal of lockfiles and node_modules and with auto-install-peers=true, the node_modules directory has none of the necessary bud dependencies (@roots/bud-terser, @roots/bud-plugin-wordpress, etc). The build process fails to import from those dependencies, and won't build.

Hey @evankford I was able to get the install and build to work with pnpm by changing the .npmrc file to:

shamefully-hoist=true
strict-peer-dependencies=false

...and removing the auto-install-peers=true line. On install, it may complain about missing peers but the build / dev works. I can't explain why, but hopefully it does for you too.

daverobertson avatar Sep 27 '22 09:09 daverobertson