react-native-bundle-visualizer icon indicating copy to clipboard operation
react-native-bundle-visualizer copied to clipboard

Cannot read property `pipe` of undefined

Open nandorojo opened this issue 3 years ago • 3 comments

npx react-native-bundle-visualizer


npx: installed 80 in 3.004s
Generating bundle...
React-native binary could not be located. Please report this issue with environment info to:
 -> [object Object]
Cannot read property 'pipe' of undefined
(node:94064) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received undefined
    at validateString (internal/validators.js:124:11)
    at normalizeSpawnArguments (child_process.js:411:3)
    at Object.spawn (child_process.js:551:13)
    at execa (/Users/fernandorojo/.npm/_npx/94064/lib/node_modules/react-native-bundle-visualizer/node_modules/execa/index.js:83:26)
    at Object.<anonymous> (/Users/fernandorojo/.npm/_npx/94064/lib/node_modules/react-native-bundle-visualizer/src/react-native-bundle-visualizer.js:114:23)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:94064) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:94064) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections th

Any idea what this might be? I'm using Expo SDK 43 in a monorepo. I'm running the command from apps/expo. I have react native 0.64.3.

nandorojo avatar Nov 21 '21 01:11 nandorojo

Auch, this must have happened because of the new yarn workspace changes: https://github.com/IjzerenHein/react-native-bundle-visualizer/commit/b9e1fe638e131075aca425b461251e30ff123904 https://github.com/IjzerenHein/react-native-bundle-visualizer/pull/69

Could you try using v3.0.0, does that also break?

IjzerenHein avatar Nov 30 '21 13:11 IjzerenHein

I'm getting the same error here. I stop yarn start and ran npm start and still the same problem

PS.: I'm using Expo

BrodaNoel avatar Mar 15 '22 14:03 BrodaNoel

Oh! I found a workaround.

I did THIS, and I GOT THE ERROR:

  • In Terminal 1, I ran yarn start
  • In Terminal 2, I ran npx react-native-bundle-visualizer
  • Got the error.
  • Stoped yarn start in Terminal 1
  • I ran npm start in Terminal 1
  • I ran again npx react-native-bundle-visualizer in Terminal 2.
  • I GOT THE ERROR.

But then... I just killed Terminal 2 and ran npx react-native-bundle-visualizer in Terminal 1, and it works.

Seems like there is some temp folder associated to the Terminal opened (zsh)

BrodaNoel avatar Mar 15 '22 14:03 BrodaNoel