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

[Bug]: Build hangs at "Output directory" #22985

Closed
pm0u opened this issue Jun 8, 2023 · 24 comments
Closed

[Bug]: Build hangs at "Output directory" #22985

pm0u opened this issue Jun 8, 2023 · 24 comments

Comments

@pm0u
Copy link

pm0u commented Jun 8, 2023

Describe the bug

We have a storybook setup using the NextJS framework and it seems to randomly hang at the step of info => Output directory: /vercel/path0/apps/joinhandshake-web/storybook-static

Output from recent build on Vercel: https://gist.github.com/pm0u/7e58e553cf3eee2ea07d9fc086d4a095

At this point it will hang for up to 45mins, which is the maximum build time on Vercel. It does also occasionally happen locally on MacOS. It does not happen every build.

  "dependencies": {
    "@headlessui/react": "^1.7.13",
    "@portabletext/react": "^2.0.0",
    "@sanity/client": "^6.1.1",
    "@sanity/image-url": "^1.0.1",
    "@types/async-retry": "^1.4.5",
    "@types/node": "^18.15",
    "@types/react": "~18.0.28",
    "@types/react-dom": "~18.0.11",
    "async-retry": "^1.3.3",
    "class-variance-authority": "^0.4.0",
    "cross-env": "^7.0.3",
    "interactjs": "^1.10.17",
    "jose": "^4.11.4",
    "lottie-react": "^2.4.0",
    "moment": "^2.29.4",
    "next": "13.3.1",
    "next-plugin-preval": "^1.2.4",
    "next-sanity": "^4.3.2",
    "next-sanity-image": "^6.0.0",
    "pixi.js": "^6.0.4",
    "postcss-media-minmax": "^5.0.0",
    "puppeteer": "^19.7.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-gist": "^1.2.4",
    "react-youtube": "^10.1.0",
    "schema-dts": "^1.1.2",
    "sharp": "^0.31.3",
    "typescript": "4.9.3"
  },
  "devDependencies": {
    "@next/bundle-analyzer": "^13.1.2",
    "@storybook/addon-a11y": "^7.0.18",
    "@storybook/addon-actions": "7.0.18",
    "@storybook/addon-essentials": "7.0.18",
    "@storybook/addon-interactions": "7.0.18",
    "@storybook/addon-links": "7.0.18",
    "@storybook/blocks": "7.0.18",
    "@storybook/nextjs": "7.0.18",
    "@storybook/react": "7.0.18",
    "@types/twitter-for-web": "^0.0.2",
    "@typescript-eslint/eslint-plugin": "^5.47.0",
    "autoprefixer": "^10.4.13",
    "eslint": "8.28.0",
    "eslint-config-next": "13.1.2",
    "eslint-config-prettier": "^8.5.0",
    "eslint-config-standard-with-typescript": "^24.0.0",
    "eslint-mdx": "^2.0.5",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-mdx": "^2.0.5",
    "eslint-plugin-n": "^15.6.0",
    "eslint-plugin-promise": "^6.1.1",
    "eslint-plugin-storybook": "^0.6.8",
    "eslint-plugin-tailwindcss": "^3.12.1",
    "file-loader": "^6.2.0",
    "postcss": "^8.4.21",
    "prettier": "^2.8.1",
    "prettier-plugin-tailwindcss": "^0.2.6",
    "sass": "^1.57.1",
    "storybook": "7.0.18",
    "stylelint": "^15.4.0",
    "stylelint-config-prettier": "^9.0.4",
    "stylelint-config-standard": "^32.0.0",
    "stylelint-prettier": "^3.0.0",
    "tailwindcss": "^3.3.2",
    "typescript-plugin-css-modules": "^5"
  }

This seems to have started with the upgrade to v7 and has occurred from versions 7.0.4 to 7.0.18. The first deployment we had this occur on, this is the package.json:

  "dependencies": {
    "@headlessui/react": "^1.7.13",
    "@portabletext/react": "^2.0.0",
    "@sanity/client": "^5.0.0",
    "@sanity/image-url": "^1.0.1",
    "@types/async-retry": "^1.4.5",
    "@types/node": "^18.15",
    "@types/react": "~18.0.28",
    "@types/react-dom": "~18.0.11",
    "async-retry": "^1.3.3",
    "class-variance-authority": "^0.4.0",
    "interactjs": "^1.10.17",
    "jose": "^4.11.4",
    "lottie-react": "^2.4.0",
    "next": "13.3.1",
    "next-plugin-preval": "^1.2.4",
    "next-sanity": "^4.1.5",
    "next-sanity-image": "^6.0.0",
    "pixi.js": "^6.0.4",
    "postcss-media-minmax": "^5.0.0",
    "puppeteer": "^19.7.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-youtube": "^10.1.0",
    "schema-dts": "^1.1.2",
    "sharp": "^0.31.3",
    "typescript": "4.9.3"
  },
  "devDependencies": {
    "@next/bundle-analyzer": "^13.1.2",
    "@storybook/addon-a11y": "^7.0.4",
    "@storybook/addon-actions": "^7.0.4",
    "@storybook/addon-essentials": "^7.0.4",
    "@storybook/addon-interactions": "^7.0.4",
    "@storybook/addon-links": "^7.0.4",
    "@storybook/blocks": "^7.0.4",
    "@storybook/nextjs": "^7.0.4",
    "@storybook/react": "^7.0.4",
    "@typescript-eslint/eslint-plugin": "^5.47.0",
    "autoprefixer": "^10.4.13",
    "eslint": "8.28.0",
    "eslint-config-next": "13.1.2",
    "eslint-config-prettier": "^8.5.0",
    "eslint-config-standard-with-typescript": "^24.0.0",
    "eslint-mdx": "^2.0.5",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-mdx": "^2.0.5",
    "eslint-plugin-n": "^15.6.0",
    "eslint-plugin-promise": "^6.1.1",
    "eslint-plugin-storybook": "^0.6.8",
    "eslint-plugin-tailwindcss": "^3.10.1",
    "file-loader": "^6.2.0",
    "jiti": "^1.18.2",
    "postcss": "^8.4.21",
    "prettier": "^2.8.1",
    "prettier-plugin-tailwindcss": "^0.2.6",
    "sass": "^1.57.1",
    "storybook": "^7.0.4",
    "stylelint": "^15.4.0",
    "stylelint-config-prettier": "^9.0.4",
    "stylelint-config-standard": "^32.0.0",
    "stylelint-prettier": "^3.0.0",
    "tailwindcss": "^3.3.1",
    "typescript-plugin-css-modules": "^5"
  }

The previous commit had the following package.json:

  "dependencies": {
  "@headlessui/react": "^1.7.13",
  "@portabletext/react": "^2.0.0",
  "@sanity/client": "^5.0.0",
  "@sanity/image-url": "^1.0.1",
  "@types/async-retry": "^1.4.5",
  "@types/node": "^18.15",
  "@types/react": "~18.0.28",
  "@types/react-dom": "~18.0.11",
  "async-retry": "^1.3.3",
  "class-variance-authority": "^0.4.0",
  "eslint-plugin-tailwindcss": "^3.10.1",
  "interactjs": "^1.10.17",
  "jose": "^4.11.4",
  "lottie-react": "^2.4.0",
  "next": "13.3.1",
  "next-plugin-preval": "^1.2.4",
  "next-sanity": "^4.1.5",
  "next-sanity-image": "^6.0.0",
  "pixi.js": "^6.0.4",
  "postcss-media-minmax": "^5.0.0",
  "puppeteer": "^19.7.1",
  "react": "18.2.0",
  "react-dom": "18.2.0",
  "react-youtube": "^10.1.0",
  "schema-dts": "^1.1.2",
  "sharp": "^0.31.3",
  "typescript": "4.9.3"
},
"devDependencies": {
  "@next/bundle-analyzer": "^13.1.2",
  "@storybook/addon-a11y": "^7.0.4",
  "@storybook/addon-actions": "^7.0.4",
  "@storybook/addon-essentials": "^7.0.4",
  "@storybook/addon-interactions": "^7.0.4",
  "@storybook/addon-links": "^7.0.4",
  "@storybook/blocks": "^7.0.4",
  "@storybook/nextjs": "^7.0.4",
  "@storybook/react": "^7.0.4",
  "@swc-node/register": "^1.6.3",
  "@swc/core": "^1.3.44",
  "@typescript-eslint/eslint-plugin": "^5.47.0",
  "autoprefixer": "^10.4.13",
  "eslint": "8.28.0",
  "eslint-config-next": "13.1.2",
  "eslint-config-prettier": "^8.5.0",
  "eslint-config-standard-with-typescript": "^24.0.0",
  "eslint-mdx": "^2.0.5",
  "eslint-plugin-import": "^2.26.0",
  "eslint-plugin-mdx": "^2.0.5",
  "eslint-plugin-n": "^15.6.0",
  "eslint-plugin-promise": "^6.1.1",
  "eslint-plugin-storybook": "^0.6.8",
  "file-loader": "^6.2.0",
  "postcss": "^8.4.21",
  "prettier": "^2.8.1",
  "prettier-plugin-tailwindcss": "^0.2.6",
  "sass": "^1.57.1",
  "storybook": "^7.0.4",
  "stylelint": "^15.4.0",
  "stylelint-config-prettier": "^9.0.4",
  "stylelint-config-standard": "^32.0.0",
  "stylelint-prettier": "^3.0.0",
  "tailwindcss": "^3.3.1",
  "typescript-plugin-css-modules": "^5"
}

There were 2 changes - adding jiti (which has now been removed in the latest/first package.json, problem persists) and moving eslint-plugin-tailwindcss to devDeps - I don't think either of these changes are likely culprits.

Other things I've tried:

  • removing any stories that had SCSS dependencies, still persisted

To Reproduce

No response

System

Environment Info:

  System:
    OS: macOS 12.6.5
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.15.0/bin/yarn
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
  Browsers:
    Chrome: 114.0.5735.106
    Firefox: 112.0.2
    Safari: 16.5

Additional context

No response

@pm0u
Copy link
Author

pm0u commented Jun 8, 2023

I've also tried running a build with DEBUG=* but there were no obvious errors or useful output at the end of the log.

I've also tried to utilize why is node running, but with this happening so infrequently it is difficult or impossible to have this work.

@pm0u pm0u changed the title [Bug]: Build Hangs at copying of static files [Bug]: Build hangs at "Output directory" Jun 8, 2023
@pm0u
Copy link
Author

pm0u commented Jun 8, 2023

Similar issues:
#15227
#15294

@pm0u
Copy link
Author

pm0u commented Jun 8, 2023

I've created a debug script that I think we will use for builds going forward to help pinpoint the issue. If we use this on every build hopefully in a few days we can get a useful log

// @ts-check
const { spawn } = require("node:child_process")
const chalk = require("chalk")

const waitMinutes = 10
const waitSeconds = waitMinutes * 60
const waitMilliseconds = waitSeconds * 1000

const whyNode = spawn(
  "why-is-node-running",
  ["./node_modules/.bin/storybook", "build"],
  { stdio: ["inherit", "pipe", "inherit"] }
)

const pidRegex = /kill -SIGUSR1 (\d+) for logging/

/** @type {string|null} */
let storybookPid = null

whyNode.stdout.on("data", (data) => {
  const match = pidRegex.exec(data)
  if (match !== null) {
    const [, pid] = match
    storybookPid = pid
  }
  console.log(/** @type {Buffer}  */ (data).toString("utf8"))
})

// wait until time set above, then log why node is running
const timeout = setTimeout(() => {
  console.error(
    chalk.redBright(
      `\n\nStorybook appears to be stuck, sending -SIGUSR1 to PID ${storybookPid}...\n`
    )
  )
  if (storybookPid !== null) {
    spawn("kill", ["-SIGUSR1", storybookPid])
    setTimeout(() => {
      console.log(chalk.redBright("\nKilling storybook process...\n"))
      whyNode.kill("SIGTERM")
      if (storybookPid !== null) {
        spawn("kill", ["-SIGTERM", storybookPid])
        console.log(chalk.redBright("\nExiting...\n"))
      }
      process.exit(1)
    }, 30000)
    return
  }
  console.log(chalk.red("No PID for storybook found"))
  process.exit(1)
}, waitMilliseconds)

// When storybook is done building, close up our timeout so the process can end - in case it hasn't run yet
whyNode.on("close", () => {
  clearTimeout(timeout)
})

Edit: updated script to fully working latest version

@pm0u
Copy link
Author

pm0u commented Jun 9, 2023

Had a deployment fail today and the output of the above script was this:



Storybook appears to be stuck, outputting what is running...

11:18:08.529 |  
11:18:08.532 | Debugger listening on ws://127.0.0.1:9229/5d3297c5-2c8a-445c-8239-5a7e944992b8
11:18:08.532 | For help, see: https://nodejs.org/en/docs/inspector
11:18:09.541 |  
11:18:09.542 | Killing storybook process...


not what I expected to see, not sure what that means? increasing the time until terminating the storybook process in case the builders are less powerful and the output was cut.

@pm0u
Copy link
Author

pm0u commented Jun 12, 2023

I have confirmed on multiple builds that there is nothing output from the why is node running process when this gets stuck:

info
 => Output directory: /Users/pmourer/Git/joinhandshake-headless-2.0/apps/joinhandshake-web/storybook-static



Storybook appears to be stuck, sending -SIGUSR1 to PID 82180...


Killing storybook process...


Exiting...

This happens for me (both getting stuck and no output from why-is-node-running) locally as well as in CI. It would be great to get some input for how to debug this further from the storybook team. I've confirmed that if I set the wait time to be very short (like 6s) to when storybook is obviously doing something there are multiple threads/stacktraces reported.

@osovv
Copy link

osovv commented Jun 13, 2023

We have the same thing with Storybook 7.0.11 on our CI, any idea how to fix it?

UPD: I managed to fix it with by adding process.exit(0) after info => Output directory log

"postinstall": " sed -i 's/import_node_logger5.logger.info(`=> Output directory: ${options.outputDir}`)/import_node_logger5.logger.info(`=> Output directory: ${options.outputDir}`),process.exit(0)/g' node_modules/@storybook/core-server/dist/index.js"

@shilman
Copy link
Member

shilman commented Jun 14, 2023

Thanks @pm0u for your detailed report & debugging attempts. I've reached out to our team to see if there are any suggestions for how to better track this down.

I'm guessing this is something specific to your setup and it would be hard to create a standalone reproduction for, but if you're up for trying you can check out https://storybook.new or see repro docs. Thank you! 🙏

@pm0u
Copy link
Author

pm0u commented Jun 14, 2023

@shilman totally understand, it'll take a little time for me to create a repro as there is quite a few moving parts in the original project.

In the meantime, after @osovv suggested changing that particular line/file I found it here:

if (!core?.disableTelemetry) {
effects.push(
initializedStoryIndexGenerator.then(async (generator) => {
const storyIndex = await generator?.getIndex();
const payload = {
precedingUpgrade: await getPrecedingUpgrade(),
};
if (storyIndex) {
Object.assign(payload, {
storyIndex: summarizeIndex(storyIndex),
});
}
await telemetry('build', payload, { configDir: options.configDir });
})
);
}

This led me to wonder if the culprit could be some separate thread/task that is spurred by the telemetry reporting. I thought this could possibly lead to no output from the main storybook thread based on this comment in the why-node-is-running readme:

Important Note! unrefed timers do not prevent the Node process from exiting. If you are running with Node v11.0.0 and above, unrefed timers will not be listed in the above list. Unfortunately, this is not supported in node versions below v11.0.0.

For now, I have disabled telemetry on our CI builds and this seems to have immediately improved the issue. I had one particular branch where this seemed to hang pretty reliably and it has now proceeded without issue across several builds. I'm going to continue monitoring.

@osovv
Copy link

osovv commented Jun 14, 2023

@pm0u I originally disabled telemetry and it still hung up
So maybe it has nothing to do with telemetry reporting

@pm0u
Copy link
Author

pm0u commented Jun 14, 2023

@osovv sorry to hear, going to continue to monitor to see if it resolves for us... best of luck in your search.

@tmeasday
Copy link
Member

@pm0u I assume you are using node>11 so I would suggest that unref-ed thing is a red herring.

Given this isn't widely reported my first thought would be it is something unusual about your storybooks. @osovv are you using NextJS also? Do either of you have custom webpack configs in main.js?

@pm0u
Copy link
Author

pm0u commented Jun 20, 2023

@tmeasday here is what my NextJS config looks like:

module.exports = {
  reactStrictMode: true,
  swcMinify: true,
  images: {
    remotePatterns: [
      {
        hostname: "cdn.sanity.io",
        protocol: "https",
        pathname: `images/${process.env.NEXT_PUBLIC_SANITY_PROJECT_ID}/**`,
      },
    ],
    deviceSizes: [640, 750, 828, 1080, 1200, 1600, 1920, 2048, 3840],
  },
  rewrites: async () => {
    return [
      {
        source: "/apple-app-site-association",
        destination: "/apple-app-site-association.json",
      },
    ]
  },
}

This is exported and imported to the root next.config.js

const nextConfig = require("./configs/next")
const createNextPluginPreval = require("next-plugin-preval/config")
const withNextPluginPreval = createNextPluginPreval()

let withBundleAnalyzer = (/** @type {any} */ args) => args

if (process.env.ANALYZE === "true") {
  withBundleAnalyzer = require("@next/bundle-analyzer")({
    enabled: true,
  })
}

module.exports = withNextPluginPreval(withBundleAnalyzer(nextConfig))

And storybook config, which does include some env injections that end up in webpack I assume:

const config = {
 stories: [], // omitted for brevity
 addons: [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-interactions",
    "@storybook/addon-a11y",
  ],
  staticDirs: [
    {
      from: "../public",
      to: "public",
    },
    {
      from: "../storybook/static",
      to: "static",
    },
  ],
  framework: {
    name: "@storybook/nextjs",
    options: {},
  },
  core: {},
  webpackFinal: (config) => {
    const rules = config.module?.rules
    if (!rules) {
      throw new Error("No webpack rules found!")
    }

    // Adds next preval compatibility to storybook webpack
    rules.push({
      test: /\.preval\.(t|j)sx?$/,
      loader: require.resolve("next-plugin-preval/loader"),
    })
    return config
  },
  docs: {
    autodocs: "tag",
  },
  env: (config) => ({
    ...config,
    NEXT_PUBLIC_SANITY_PROJECT_ID:
      process.env.NEXT_PUBLIC_SANITY_PROJECT_ID ?? "",
    NEXT_PUBLIC_FACEBOOK_APP_ID: process.env.NEXT_PUBLIC_FACEBOOK_APP_ID ?? "",
    NEXT_PUBLIC_FACEBOOK_CLIENT_TOKEN:
      process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_TOKEN ?? "",
  }),
}

I suppose the obvious red flag here is next-plugin-preval as this does make an asynchronous request during the webpack build but I don't see any other reported errors there of something similar. I could also try removing the bundle analyzer OR pointing storybook to the Next config that doesn't include those plugins (We would need preval, somehow to fetch "server side" data for the build. I suppose if this was the issue I could come up with a workaround).

I re-read the note about un-refed timers several more times and now see that I misunderstood initially, you are correct this shouldn't impact us (Node 18)

@tmeasday
Copy link
Member

@pm0u is your issue reproducable consistently? Is there some way you could try dropping the next-plugin-preval on a branch to see if it fixes it? It would definitely make sense to look at that first, as you say it's sticking out like a sore thumb here :).

IIUC the bundle analyzer isn't being used so I'd say is unlikely to be relevant.

@pm0u
Copy link
Author

pm0u commented Jun 21, 2023

@tmeasday I did have one commit that at one point, inexplicably, seemed to get stuck reliably. I can look into seeing if dropping that works.

I will add, FWIW, the reason that particular branch/commit stopped hanging was because I disabled telemetry... since disabling telemetry we have had over 30+ deploys without issue. In the past this issue would pop up within a few deploys typically (and on that particular problematic branch/commit it was 5+ in a row) . Not saying this is resolved for certain, but there has at least been a change in behavior with telemetry disabled.

I will find some time to look into the preval plugin

@tmeasday
Copy link
Member

Well I think the telemetry does do some requests in the background so it's believable that it could hold the process up waiting on them I guess. I'm not sure why it happens here and not elsewhere though 🤷

@tony-scio
Copy link

tony-scio commented Jul 1, 2023

As one more data point, we were experiencing this hang about 1 in 5 runs on local macbook pro m1s. We had telemetry disabled in main.js. This wasn't enough (per the note in https://storybook.js.org/docs/react/configure/telemetry#how-to-opt-out that there is an event prior to processing main.js). Disabling it on the command line via --disable-telemetry appears to have made it rock solid.

In case helpful, here's a why-is-node-running log from when telemetry was running and it hung.

# FSREQCALLBACK
node:internal/async_hooks:202
There are 29 handle(s) keeping the process running

# Timeout
node:internal/async_hooks:202                                                                                                   
node:internal/async_hooks:505                                                                                                   
node:internal/timers:164                                                                                                        
node:internal/timers:198                                                                                                        
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/storybook/index.js:4 - setInterval(log, 2000)
node:internal/modules/cjs/loader:1254                                                                                           
node:internal/modules/cjs/loader:1308                                                                                           
node:internal/modules/cjs/loader:1117                                                                                           

# PIPEWRAP
node:internal/async_hooks:202                      
node:internal/bootstrap/switches/is_main_thread:222
node:internal/bootstrap/loaders:190                
node:internal/bootstrap/loaders:314                
node:internal/bootstrap/loaders:294                
node:internal/bootstrap/loaders:299                

# DNSCHANNEL
node:internal/async_hooks:202       
node:internal/dns/utils:79          
node:internal/dns/utils:74          
node:internal/dns/utils:241         
node:internal/dns/utils:251         
node:internal/bootstrap/loaders:334 
node:internal/bootstrap/loaders:270 
node:internal/modules/cjs/helpers:56

# JSSTREAM
node:internal/async_hooks:202                                                                                                                        
node:internal/js_stream_socket:49                                                                                                                    
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:2621 - var JSStreamSocket = new tls.TLSSocket(new stream2.PassThrough())._handle._parentWrap.constructor;
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:9    - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:2710 - var JSStreamSocket = require_js_stream_socket();
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:9    - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:2911 - } = require_h1_over_h2();
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:9    - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;

# TLSWRAP
node:internal/async_hooks:202                                                                                                                        
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:2621 - var JSStreamSocket = new tls.TLSSocket(new stream2.PassThrough())._handle._parentWrap.constructor;
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:9    - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:2710 - var JSStreamSocket = require_js_stream_socket();
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:9    - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:2911 - } = require_h1_over_h2();
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@ndelangen/get-tarball/dist/index.js:9    - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;

# FILEHANDLE
node:internal/async_hooks:202

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                              
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/external/build_bazel_rules_nodejs/internal/node/node_patches.cjs:135                                          - origLstat(...args);
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:751            - self.fs.lstat(abs, statcb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:675            - this._stat(prefix, function (er, exists) {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:322            - this._processSimple(pattern.join('/'), index, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:167            - this._process(this.minimatch.set[i], i, false, done)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:72             - return new Glob(pattern, options, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob-promise/lib/index.js:5 - glob(pattern, options, (err, files) => err === null ? resolve(files) : reject(err))

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                              
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/external/build_bazel_rules_nodejs/internal/node/node_patches.cjs:135                                          - origLstat(...args);
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:751            - self.fs.lstat(abs, statcb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:675            - this._stat(prefix, function (er, exists) {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:322            - this._processSimple(pattern.join('/'), index, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:167            - this._process(this.minimatch.set[i], i, false, done)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:72             - return new Glob(pattern, options, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob-promise/lib/index.js:5 - glob(pattern, options, (err, files) => err === null ? resolve(files) : reject(err))

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                              
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/external/build_bazel_rules_nodejs/internal/node/node_patches.cjs:135                                          - origLstat(...args);
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:751            - self.fs.lstat(abs, statcb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:675            - this._stat(prefix, function (er, exists) {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:322            - this._processSimple(pattern.join('/'), index, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:167            - this._process(this.minimatch.set[i], i, false, done)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:72             - return new Glob(pattern, options, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob-promise/lib/index.js:5 - glob(pattern, options, (err, files) => err === null ? resolve(files) : reject(err))

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                              
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/external/build_bazel_rules_nodejs/internal/node/node_patches.cjs:135                                          - origLstat(...args);
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:751            - self.fs.lstat(abs, statcb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:675            - this._stat(prefix, function (er, exists) {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:322            - this._processSimple(pattern.join('/'), index, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:167            - this._process(this.minimatch.set[i], i, false, done)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:72             - return new Glob(pattern, options, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob-promise/lib/index.js:5 - glob(pattern, options, (err, files) => err === null ? resolve(files) : reject(err))

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                              
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/external/build_bazel_rules_nodejs/internal/node/node_patches.cjs:135                                          - origLstat(...args);
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:751            - self.fs.lstat(abs, statcb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:675            - this._stat(prefix, function (er, exists) {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:322            - this._processSimple(pattern.join('/'), index, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:167            - this._process(this.minimatch.set[i], i, false, done)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:72             - return new Glob(pattern, options, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob-promise/lib/index.js:5 - glob(pattern, options, (err, files) => err === null ? resolve(files) : reject(err))

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                              
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/external/build_bazel_rules_nodejs/internal/node/node_patches.cjs:135                                          - origLstat(...args);
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:751            - self.fs.lstat(abs, statcb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:675            - this._stat(prefix, function (er, exists) {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:322            - this._processSimple(pattern.join('/'), index, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:167            - this._process(this.minimatch.set[i], i, false, done)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:72             - return new Glob(pattern, options, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob-promise/lib/index.js:5 - glob(pattern, options, (err, files) => err === null ? resolve(files) : reject(err))

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                              
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/external/build_bazel_rules_nodejs/internal/node/node_patches.cjs:135                                          - origLstat(...args);
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:751            - self.fs.lstat(abs, statcb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:675            - this._stat(prefix, function (er, exists) {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:322            - this._processSimple(pattern.join('/'), index, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:167            - this._process(this.minimatch.set[i], i, false, done)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:72             - return new Glob(pattern, options, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob-promise/lib/index.js:5 - glob(pattern, options, (err, files) => err === null ? resolve(files) : reject(err))

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                              
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/external/build_bazel_rules_nodejs/internal/node/node_patches.cjs:135                                          - origLstat(...args);
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:751            - self.fs.lstat(abs, statcb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:675            - this._stat(prefix, function (er, exists) {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:322            - this._processSimple(pattern.join('/'), index, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:167            - this._process(this.minimatch.set[i], i, false, done)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob/glob.js:72             - return new Glob(pattern, options, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/node_modules/glob-promise/lib/index.js:5 - glob(pattern, options, (err, files) => err === null ? resolve(files) : reject(err))

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                          
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/graceful-fs.js:118              - return fs$readFile(path, options, function (err) {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/graceful-fs.js:115              - return go$readFile(path, options, cb)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                     - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                     - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/builder-manager/dist/index.js:46

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                       
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                                  - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                                  - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/path-exists/index.js:6                      - return fs.access(path).then(() => true).catch(() => false)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:21                                 - if (typeof cb !== 'function') return fn.apply(this, args)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-server/dist/presets/common-preset.js:106
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-common/dist/index.js:15                  - `)}catch(e){let warning=level>0?`  Failed to load preset: ${JSON.stringify(input)} on level ${level}`:`  Failed to load preset: ${JSON.stringify(input)}`;return import_node_logger2.logger.warn(warning),import_node_logger2.logger.error(e),[]}}async function loadPresets(presets,level,storybookOptions){return!presets||!Array.isArray(presets)||!presets.length?[]:(await Promise.all(presets.map(async preset=>loadPreset(preset,level,storybookOptions)))).reduce((acc,loaded)=>acc.concat(loaded),[])}function applyPresets(presets,extension,config,args,storybookOptions){let presetResult=new Promise(res=>res(config));return presets.length?presets.reduce((accumulationPromise,{preset,options})=>{let change=preset[extension];if(!change)return accumulationPromise;if(typeof change=="function"){let extensionFn=change,context={preset,combinedOptions:{...storybookOptions,...args,...options,presetsList:presets,presets:{apply:async(ext,c,a={})=>applyPresets(presets,ext,c,a,storybookOptions)}}};return accumulationPromise.then(newConfig=>extensionFn.call(context.preset,newConfig,context.combinedOptions))}return accumulationPromise.then(newConfig=>Array.isArray(newConfig)&&Array.isArray(change)?[...newConfig,...change]:isObject(newConfig)&&isObject(change)?{...newConfig,...change}:change)},presetResult):presetResult}async function getPresets(presets,storybookOptions){let loadedPresets=await loadPresets(presets,0,storybookOptions);return{apply:async(extension,config,args={})=>applyPresets(loadedPresets,extension,config,args,storybookOptions)}}async function loadAllPresets(options){let{corePresets=[],overridePresets=[],...restOptions}=options,presetsConfig=[...corePresets,...loadCustomPresets(options),...overridePresets],filteredPresetConfig=filterPresetsConfig(presetsConfig);return filteredPresetConfig.length<presetsConfig.length&&import_node_logger2.logger.warn("Storybook now supports TypeScript natively. You can safely remove `@storybook/preset-typescript`."),getPresets(filteredPresetConfig,restOptions)}var import_file_system_cache=__toESM(require("file-system-cache"));function createFileSystemCache(options){return(0,import_file_system_cache.default)(options)}var import_path5=__toESM(require("path")),import_pkg_dir=__toESM(require("pkg-dir"));function resolvePathInStorybookCache(fileOrDirectoryName){let cwd=process.cwd(),projectDir=import_pkg_dir.default.sync(cwd),cacheDirectory;return projectDir?cacheDirectory=import_path5.default.resolve(projectDir,"node_modules/.cache/storybook"):cacheDirectory=import_path5.default.resolve(cwd,".cache/storybook"),import_path5.default.join(cacheDirectory,fileOrDirectoryName)}var cache=createFileSystemCache({basePath:resolvePathInStorybookCache("dev-server"),ns:"storybook"});var import_node_logger3=require("@storybook/node-logger"),predicateFor=addon=>entry=>{let name=entry.name||entry;return name&&name.includes(addon)},isCorrectOrder=(addons,before,after)=>{let essentialsIndex=addons.findIndex(predicateFor("@storybook/addon-essentials")),beforeIndex=addons.findIndex(predicateFor(before.name)),afterIndex=addons.findIndex(predicateFor(after.name));return beforeIndex===-1&&before.inEssentials&&(beforeIndex=essentialsIndex),afterIndex===-1&&after.inEssentials&&(afterIndex=essentialsIndex),beforeIndex!==-1&&afterIndex!==-1&&beforeIndex<=afterIndex},checkAddonOrder=async({before,after,configFile,getConfig})=>{try{let config=await getConfig(configFile);if(!(config!=null&&config.addons)){import_node_logger3.logger.warn("Unable to find 'addons' config in main Storybook config");return}if(!isCorrectOrder(config.addons,before,after)){let orEssentials=" (or '@storybook/addon-essentials')",beforeText=`'${before.name}'${before.inEssentials?orEssentials:""}`,afterText=`'${after.name}'${after.inEssentials?orEssentials:""}`;import_node_logger3.logger.warn(`Expected ${beforeText} to be listed before ${afterText} in main Storybook config.`)}}catch{import_node_logger3.logger.warn(`Unable to load config file: ${configFile}`)}};var import_lazy_universal_dotenv=require("lazy-universal-dotenv");var import_path6=__toESM(require("path")),import_find_up=__toESM(require("find-up")),getProjectRoot=()=>{let result;try{let found=import_find_up.default.sync(".git",{type:"directory"});found&&(result=import_path6.default.join(found,".."))}catch{}try{let found=import_find_up.default.sync(".svn",{type:"directory"});found&&(result=result||import_path6.default.join(found,".."))}catch{}try{let found=import_find_up.default.sync(".yarn",{type:"directory"});found&&(result=result||import_path6.default.join(found,".."))}catch{}try{result=result||__dirname.split("node_modules")[0]}catch{}return result||process.cwd()},nodePathsToArray=nodePath=>nodePath.split(process.platform==="win32"?";":":").filter(Boolean).map(p=>import_path6.default.resolve("./",p)),relativePattern=/^\.{1,2}([/\\]|$)/;function normalizeStoryPath(filename){return relativePattern.test(filename)?filename:`.${import_path6.default.sep}${filename}`}function loadEnvs(options={}){let defaultNodeEnv=options.production?"production":"development",env={NODE_ENV:process.env.NODE_ENV||defaultNodeEnv,NODE_PATH:process.env.NODE_PATH||"",STORYBOOK:process.env.STORYBOOK||"true",PUBLIC_URL:options.production?".":""};Object.keys(process.env).filter(name=>/^STORYBOOK_/.test(name)).forEach(name=>{env[name]=process.env[name]});let base=Object.entries(env).reduce((acc,[k,v])=>Object.assign(acc,{[k]:JSON.stringify(v)}),{}),{stringified,raw}=(0,import_lazy_universal_dotenv.getEnvironment)({nodeEnv:env.NODE_ENV}),fullRaw={...env,...raw};return fullRaw.NODE_PATH=nodePathsToArray(fullRaw.NODE_PATH||""),{stringified:{...base,...stringified},raw:fullRaw}}var stringifyEnvs=raw=>Object.entries(raw).reduce((acc,[key,value])=>(acc[key]=JSON.stringify(value),acc),{}),stringifyProcessEnvs=raw=>Object.entries(raw).reduce((acc,[key,value])=>(acc[`process.env.${key}`]=JSON.stringify(value),acc),{});var import_path7=__toESM(require("path")),import_find_up2=require("find-up"),findDistEsm=(cwd,relativePath)=>{let nearestPackageJson=(0,import_find_up2.sync)("package.json",{cwd});if(!nearestPackageJson)throw new Error(`Could not find package.json in: ${cwd}`);let packageDir=import_path7.default.dirname(nearestPackageJson);return import_path7.default.join(packageDir,"dist","esm",relativePath)};var NODE_MODULES_RE=/node_modules/,commonGlobOptions=glob2=>NODE_MODULES_RE.test(glob2)?{}:{ignore:["**/node_modules/**"]};async function getBuilderOptions(options){var _a;let framework=await options.presets.apply("framework",{},options);if(typeof framework!="string"&&((_a=framework==null?void 0:framework.options)!=null&&_a.builder))return framework.options.builder;let{builder}=await options.presets.apply("core",{},options);return typeof builder!="string"&&(builder!=null&&builder.options)?builder.options:{}}var import_ts_dedent3=require("ts-dedent");async function getFrameworkName(options){let framework=await options.presets.apply("framework","",options);if(!framework)throw new Error(import_ts_dedent3.dedent`

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                      
node:internal/util:375                                                                                                             
node:internal/util:361                                                                                                             
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/locate-path/index.js:39 - const stat = await statFn(path.resolve(options.cwd, path_));
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/p-locate/index.js:12    - const testElement = async (element, tester) => tester(await element);

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                      
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                                 - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                                 - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/path-exists/index.js:6                     - return fs.access(path).then(() => true).catch(() => false)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:21                                - if (typeof cb !== 'function') return fn.apply(this, args)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-server/dist/presets/common-preset.js:48
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-server/dist/presets/common-preset.js:61

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                                      
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                                 - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                                 - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/path-exists/index.js:6                     - return fs.access(path).then(() => true).catch(() => false)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:21                                - if (typeof cb !== 'function') return fn.apply(this, args)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-server/dist/presets/common-preset.js:48
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/core-server/dist/presets/common-preset.js:61

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                          
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/polyfills.js:309                - : orig.call(fs, target, callback)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/ensure/file.js:16              - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                     - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                     - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/builder-manager/dist/index.js:67

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                          
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/polyfills.js:309                - : orig.call(fs, target, callback)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/ensure/file.js:16              - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                     - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                     - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/builder-manager/dist/index.js:67

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                          
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/polyfills.js:309                - : orig.call(fs, target, callback)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/ensure/file.js:16              - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                     - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                     - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/builder-manager/dist/index.js:67

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                          
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/polyfills.js:309                - : orig.call(fs, target, callback)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/ensure/file.js:16              - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                     - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                     - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/builder-manager/dist/index.js:67

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                          
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/polyfills.js:309                - : orig.call(fs, target, callback)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/ensure/file.js:16              - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                     - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                     - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/builder-manager/dist/index.js:67

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                          
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/polyfills.js:309                - : orig.call(fs, target, callback)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/ensure/file.js:16              - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                     - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                     - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/builder-manager/dist/index.js:67

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                          
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/polyfills.js:309                - : orig.call(fs, target, callback)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/ensure/file.js:16              - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                     - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                     - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/builder-manager/dist/index.js:67

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                          
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/polyfills.js:309                - : orig.call(fs, target, callback)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/ensure/file.js:16              - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                     - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                     - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/builder-manager/dist/index.js:67

# FSREQCALLBACK
node:internal/async_hooks:202                                                                                                                          
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/graceful-fs/polyfills.js:309                - : orig.call(fs, target, callback)
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/fs-extra/lib/ensure/file.js:16              - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:8                     - fn.call(
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/universalify/index.js:7                     - return new Promise((resolve, reject) => {
/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/@storybook/builder-manager/dist/index.js:67

# FSREQCALLBACK
node:internal/async_hooks:202

@tmeasday
Copy link
Member

tmeasday commented Jul 3, 2023

Ok, interesting @tony-scio. We'll investigate. In the meantime, the --disable-telemetry flag seems like the workaround here.

@tmeasday
Copy link
Member

tmeasday commented Jul 3, 2023

@tony-scio what is this line?

/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/storybook/index.js:4 - setInterval(log, 2000)

I don't see any such intervals in the SB codebase. What version are you on?

@tony-scio
Copy link

@tony-scio what is this line?

/private/var/tmp/_bazel_tony/7ebbc78ad9e9d4b46d567aa33c850b0b/execroot/com_github_askscio_scio/node_modules/storybook/index.js:4 - setInterval(log, 2000)

I don't see any such intervals in the SB codebase. What version are you on?

That was how I hacked in why-is-node-running when diagnosing. https://github.com/mafintosh/why-is-node-running#usage

@tmeasday
Copy link
Member

tmeasday commented Jul 4, 2023

@tony-scio I'm not sure I know how to read that trace (are you sure it was the full thing?) but I don't see anything in there that looks like it has anything to do with telemetry. Most of the entries are coming from the builder which is a bit weird if building is done. I'm not sure about the FSREQCALLBACKs, there seem a lot of them from a lot of places that should be "finished".

If you disregard them, then what's left is basically just some calls from inside https://www.npmjs.com/package/@ndelangen/get-tarball, which is odd because it certainly isn't used at all (it's only used during sb init IIUC).

You could try commenting out the import of it (here in the source code), and see how that affects things?

@github-actions
Copy link
Contributor

Hi there! Thank you for opening this issue, but it has been marked as stale because we need more information to move forward. Could you please provide us with the requested reproduction or additional information that could help us better understand the problem? We'd love to resolve this issue, but we can't do it without your help!

@github-actions github-actions bot added the Stale label Jul 26, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

I'm afraid we need to close this issue for now, since we can't take any action without the requested reproduction or additional information. But please don't hesitate to open a new issue if the problem persists – we're always happy to help. Thanks so much for your understanding.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2023
@lawlesscreation
Copy link

lawlesscreation commented Dec 22, 2023

To add, we've seen the same issue after updating from SB 6 to 7 using Node 18. Setting core: { disableTelemetry: true }, in the main.ts file did not work, but running stencil build with the --disable-telemetry flag did work. Not really a fix, but a workaround at least. Thanks.

N.B: I noticed this in the docs, I wonder if it's related as it would explain why the disableTelemetry option didn't work but the flag did:

There is a boot event containing no metadata (used to ensure the telemetry is working). It is sent prior to evaluating your Storybook configuration file (i.e., main.js|ts), so it is unaffected by the disableTelemetry option. If you want to ensure that the event is not sent, use the STORYBOOK_DISABLE_TELEMETRY environment variable.

@filipw01
Copy link

filipw01 commented Feb 1, 2024

in my case it was because I had some stories fully commented out, they were mentioned at the top of the logs, but the process didn't quit it was stuck instead

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

No branches or pull requests

7 participants