entropyxyz / sdk

Official JavaScript SDK for Entropy blockchain.
GNU Affero General Public License v3.0
7 stars 0 forks source link

Provide Descriptive Errors for Production Environments #250

Closed benschac closed 4 months ago

benschac commented 8 months ago

https://vercel.com/entropyxyz/entropy-client-next/1Ydmzf4f2tZJpsDMh32eqEFN5x5q

https://github.com/entropyxyz/entropy-client/pull/129

it's running jest commands, I don't have any test setup / testing installed on my project. Only change was install / using entropy-js

benschac commented 8 months ago

also, trying to hit API-WS: disconnected from ws://127.0.0.1:9944: from default. Might be worth adding a `process.env.production check for a more detailed error to be thrown, if sdk reads that websocket by default.

benschac commented 8 months ago

This one is probably the highest priority for web, if possible could y'all add it to the next sprint 🙏🏻

benschac commented 7 months ago

Here's the error log from the link above while we wait for @vitropy to get @frankiebee access to vercel.

[08:54:51.336] Running build in Washington, D.C., USA (East) – iad1 (Hive)
[08:54:51.446] Cloning github.com/entropyxyz/entropy-client (Branch: 11-15-add_entropyjs_to_home_screen, Commit: fc37d18)
[08:54:52.108] Cloning completed: 662.134ms
[08:55:03.822] Restored build cache
[08:55:03.906] Running "vercel build"
[08:55:04.627] Vercel CLI 32.5.5
[08:55:04.847] > Detected Turbo. Adjusting default settings...
[08:55:05.139] Running "install" command: `yarn set version berry && yarn install`...
[08:55:06.032] ➤ YN0000: Downloading https://repo.yarnpkg.com/4.0.2/packages/yarnpkg-cli/bin/yarn.js
[08:55:06.104] ➤ YN0000: Saving the new release in ../../.yarn/releases/yarn-4.0.2.cjs
[08:55:06.185] ➤ YN0000: Done in 0s 154ms
[08:55:06.970] ➤ YN0000: · Yarn 4.0.2
[08:55:06.971] ➤ YN0000: ┌ Project validation
[08:55:06.972] ➤ YN0057: │ expo-app: Resolutions field will be ignored
[08:55:06.972] ➤ YN0000: └ Completed
[08:55:06.987] ➤ YN0000: ┌ Resolution step
[08:55:07.922] ➤ YN0000: └ Completed in 0s 934ms
[08:55:08.051] ➤ YN0000: ┌ Fetch step
[08:56:01.355] ➤ YN0000: └ Completed in 53s 303ms
[08:56:01.476] ➤ YN0000: ┌ Link step
[08:56:05.411] ➤ YN0007: │ entropy-client@workspace:. must be built because it never has been before or the last one failed
[08:56:05.419] ➤ YN0007: │ @shopify/react-native-skia@npm:0.1.196 [72208] must be built because it never has been before or the last one failed
[08:56:05.420] ➤ YN0007: │ esbuild@npm:0.19.6 must be built because it never has been before or the last one failed
[08:56:05.420] ➤ YN0007: │ esbuild@npm:0.14.47 must be built because it never has been before or the last one failed
[08:56:05.421] ➤ YN0007: │ esbuild@npm:0.19.5 must be built because it never has been before or the last one failed
[08:56:05.421] ➤ YN0007: │ @substrate/connect@npm:0.7.33 must be built because it never has been before or the last one failed
[08:56:06.743] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Updating symlinks for Android build...
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to api /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to jsi /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to rnskia /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to skia /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to utils /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Symlinks created successfully.
[08:56:09.055] ➤ YN0000: │ entropy-client@workspace:. STDOUT $ npx tsc --baseUrl . --outDir types --rootDir src --emitDeclarationOnly --declarationMap
[08:56:19.166] ➤ YN0000: │ entropy-client@workspace:. STDOUT built @my/ui in 10120 ms
[08:56:19.171] ➤ YN0000: │ entropy-client@workspace:. STDOUT Done in 10s 597ms
[08:56:19.204] ➤ YN0000: └ Completed in 17s 728ms
[08:56:19.503] ➤ YN0000: · Done with warnings in 1m 13s
[08:56:19.847] Detected Next.js version: 13.5.6
[08:56:19.847] Running "turbo run build"
[08:56:20.104] • Packages in scope: next-app
[08:56:20.105] • Running build in 1 packages
[08:56:20.105] • Remote caching enabled
[08:56:21.264] @my/ui:build: cache miss, executing 6260b0d6c5d70f74
[08:56:22.274] @my/ui:build: $ npx tsc --baseUrl . --outDir types --rootDir src --emitDeclarationOnly --declarationMap
[08:56:30.711] @my/ui:build: built @my/ui in 8463 ms
[08:56:30.837] next-app:build: cache miss, executing 2d432234b7ec0451
[08:56:33.705] next-app:build: $ npx tsc --baseUrl . --outDir types --rootDir src --emitDeclarationOnly --declarationMap
[08:56:42.028] next-app:build: built @my/ui in 8350 ms
[08:56:42.038] next-app:build: Done in 8s 844ms
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: Welcome to Tamagui!
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: You can update this monorepo to the latest Tamagui release just by running:
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: yarn upgrade:tamagui
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: We've set up a few things for you.
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: See the "excludeReactNativeWebExports" setting in next.config.js, which omits these
[08:56:43.208] next-app:build: from the bundle: Switch, ProgressBar Picker, CheckBox, Touchable. To save more,
[08:56:43.208] next-app:build: you can add ones you don't need like: AnimatedFlatList, FlatList, SectionList,
[08:56:43.209] next-app:build: VirtualizedList, VirtualizedSectionList.
[08:56:43.209] next-app:build: 
[08:56:43.209] next-app:build: Even better, enable "useReactNativeWebLite" and you can remove the
[08:56:43.209] next-app:build: excludeReactNativeWebExports setting altogether and get tree-shaking and
[08:56:43.209] next-app:build: concurrent mode support as well.
[08:56:43.209] next-app:build: 
[08:56:43.209] next-app:build: 🐣
[08:56:43.209] next-app:build: 
[08:56:43.209] next-app:build: Remove this log in next.config.js.
[08:56:43.209] next-app:build: 
[08:56:43.209] next-app:build: 
[08:56:43.363] next-app:build:    Skipping validation of types
[08:56:43.363] next-app:build:    Linting ...
[08:56:44.944] next-app:build:    Creating an optimized production build ...
[08:56:45.176] next-app:build:    Disabled SWC as replacement for Babel because of custom Babel configuration "babel.config.js" https://nextjs.org/docs/messages/swc-disabled
[08:56:46.390] next-app:build: 
[08:56:46.390] next-app:build:     ➡ [tamagui] built config and components (964ms):
[08:56:46.390] next-app:build: 
[08:56:46.390] next-app:build:         Config     ./.tamagui/tamagui.config.cjs
[08:56:46.390] next-app:build:         Components ./.tamagui/tamagui-components.config.cjs
[08:56:46.390] next-app:build:              ./.tamagui/myui-components.config.cjs
[08:56:46.390] next-app:build:         
[08:56:47.068] next-app:build:     ➡ [tamagui] output css: ./public/tamagui.css
[08:56:47.068] next-app:build: 
[08:56:48.701] next-app:build:    Using external babel configuration from /vercel/path0/apps/next/babel.config.js
[08:56:49.660] next-app:build:  web  |                    screen   ·    4 found   ·    2 opt   ·    1 flat    39ms 
[08:56:49.976] next-app:build:  web  |                    screen   ·   15 found   ·   13 opt   ·   14 flat   188ms 
[08:56:51.860] next-app:build:  web  |              FunctionCard   ·    4 found   ·    3 opt   ·    2 flat    20ms 
[08:56:51.860] next-app:build:  web  |               EntropyLogo   ·    1 found   ·    0 opt   ·    1 flat    19ms 
[08:56:54.216] next-app:build:  web  |               NativeToast   ·    1 found   ·    0 opt   ·    1 flat     9ms 
[08:56:55.905] next-app:build:  web  |               FormWrapper   ·    4 found   ·    3 opt   ·    0 flat    10ms 
[08:57:15.292] next-app:build:  web  |                    screen   ·    4 found   ·    2 opt   ·    1 flat    73ms 
[08:57:15.294] next-app:build:  web  |                    screen   ·   15 found   ·   13 opt   ·   14 flat    72ms 
[08:57:16.429] next-app:build:  web  |              FunctionCard   ·    4 found   ·    3 opt   ·    2 flat    16ms 
[08:57:16.430] next-app:build:  web  |               EntropyLogo   ·    1 found   ·    0 opt   ·    1 flat    17ms 
[08:57:17.567] next-app:build:  web  |               NativeToast   ·    1 found   ·    0 opt   ·    1 flat    15ms 
[08:57:17.568] next-app:build:  web  |               FormWrapper   ·    4 found   ·    3 opt   ·    0 flat    15ms 
[08:57:47.941] next-app:build:  ✓ Compiled successfully
[08:57:47.942] next-app:build:    Collecting page data ...
[08:57:49.852] next-app:build: @polkadot/keyring has multiple versions, ensure that there is only one installed.
[08:57:49.852] next-app:build: Either remove and explicitly install matching versions or dedupe using your package manager.
[08:57:49.852] next-app:build: The following conflicting packages were found:
[08:57:49.852] next-app:build:  cjs 12.5.1  node_modules/@polkadot/keyring/cjs
[08:57:49.852] next-app:build:  esm 12.5.1  <unknown>
[08:57:50.258] next-app:build:    Generating static pages (0/4) ...
[08:57:52.302] next-app:build: 
   Generating static pages (1/4) 
[08:57:52.303] next-app:build: 2023-11-20 16:57:50          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
[08:57:52.303] next-app:build: node:internal/process/promises:288
[08:57:52.303] next-app:build:             triggerUncaughtException(err, true /* fromPromise */);
[08:57:52.303] next-app:build:             ^
[08:57:52.303] next-app:build: 
[08:57:52.303] next-app:build: [UnhandledPromiseRejection: 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(). The promise rejected with the reason "#<ErrorEvent>".] {
[08:57:52.303] next-app:build:   code: 'ERR_UNHANDLED_REJECTION'
[08:57:52.303] next-app:build: }
[08:57:52.303] next-app:build: 
[08:57:52.303] next-app:build: Node.js v18.17.1
[08:57:52.375] next-app:build: Static worker unexpectedly exited with code: 1 and signal: null
[08:57:52.386] next-app:build: 
   Generating static pages (2/4) 
[08:57:52.387] next-app:build: 
   Generating static pages (3/4) 
[08:57:53.997] next-app:build: @polkadot/keyring has multiple versions, ensure that there is only one installed.
[08:57:53.997] next-app:build: Either remove and explicitly install matching versions or dedupe using your package manager.
[08:57:53.997] next-app:build: The following conflicting packages were found:
[08:57:53.997] next-app:build:  cjs 12.5.1  node_modules/@polkadot/keyring/cjs
[08:57:53.997] next-app:build:  esm 12.5.1  <unknown>
[08:57:54.115] next-app:build: 2023-11-20 16:57:54          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
[08:57:54.115] next-app:build: node:internal/process/promises:288
[08:57:54.115] next-app:build:             triggerUncaughtException(err, true /* fromPromise */);
[08:57:54.115] next-app:build:             ^
[08:57:54.115] next-app:build: 
[08:57:54.115] next-app:build: [UnhandledPromiseRejection: 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(). The promise rejected with the reason "#<ErrorEvent>".] {
[08:57:54.115] next-app:build:   code: 'ERR_UNHANDLED_REJECTION'
[08:57:54.115] next-app:build: }
[08:57:54.115] next-app:build: 
[08:57:54.115] next-app:build: Node.js v18.17.1
[08:57:55.800] next-app:build: @polkadot/keyring has multiple versions, ensure that there is only one installed.
[08:57:55.800] next-app:build: Either remove and explicitly install matching versions or dedupe using your package manager.
[08:57:55.800] next-app:build: The following conflicting packages were found:
[08:57:55.800] next-app:build:  cjs 12.5.1  node_modules/@polkadot/keyring/cjs
[08:57:55.800] next-app:build:  esm 12.5.1  <unknown>
[08:57:56.504] next-app:build: 2023-11-20 16:57:56          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
[08:57:56.505] next-app:build: node:internal/process/promises:288
[08:57:56.505] next-app:build:             triggerUncaughtException(err, true /* fromPromise */);
[08:57:56.505] next-app:build:             ^
[08:57:56.505] next-app:build: 
[08:57:56.505] next-app:build: [UnhandledPromiseRejection: 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(). The promise rejected with the reason "#<ErrorEvent>".] {
[08:57:56.505] next-app:build:   code: 'ERR_UNHANDLED_REJECTION'
[08:57:56.505] next-app:build: }
[08:57:56.505] next-app:build: 
[08:57:56.505] next-app:build: Node.js v18.17.1
[08:57:58.416] next-app:build: @polkadot/keyring has multiple versions, ensure that there is only one installed.
[08:57:58.416] next-app:build: Either remove and explicitly install matching versions or dedupe using your package manager.
[08:57:58.416] next-app:build: The following conflicting packages were found:
[08:57:58.416] next-app:build:  cjs 12.5.1  node_modules/@polkadot/keyring/cjs
[08:57:58.416] next-app:build:  esm 12.5.1  <unknown>
[08:57:59.077] next-app:build: 2023-11-20 16:57:58          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
[08:57:59.078] next-app:build: node:internal/process/promises:288
[08:57:59.078] next-app:build:             triggerUncaughtException(err, true /* fromPromise */);
[08:57:59.078] next-app:build:             ^
[08:57:59.078] next-app:build: 
[08:57:59.078] next-app:build: [UnhandledPromiseRejection: 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(). The promise rejected with the reason "#<ErrorEvent>".] {
[08:57:59.078] next-app:build:   code: 'ERR_UNHANDLED_REJECTION'
[08:57:59.078] next-app:build: }
[08:57:59.078] next-app:build: 
[08:57:59.078] next-app:build: Node.js v18.17.1
[08:57:59.169] next-app:build: 
[08:57:59.169] next-app:build: > Build error occurred
[08:57:59.171] next-app:build: Error: Jest worker encountered 4 child process exceptions, exceeding retry limit
[08:57:59.171] next-app:build:     at ChildProcessWorker.initialize (/vercel/path0/node_modules/next/dist/compiled/jest-worker/index.js:1:11580)
[08:57:59.172] next-app:build:     at ChildProcessWorker._onExit (/vercel/path0/node_modules/next/dist/compiled/jest-worker/index.js:1:12545)
[08:57:59.172] next-app:build:     at ChildProcess.emit (node:events:514:28)
[08:57:59.172] next-app:build:     at ChildProcess.emit (node:domain:489:12)
[08:57:59.172] next-app:build:     at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
[08:57:59.172] next-app:build:   type: 'WorkerError'
[08:57:59.172] next-app:build: }
[08:57:59.363] next-app:build: ERROR: command finished with error: command (/vercel/path0/apps/next) yarn run build exited (1)
[08:57:59.363] next-app#build: command (/vercel/path0/apps/next) yarn run build exited (1)
[08:57:59.364] 
[08:57:59.364]   Tasks:    1 successful, 2 total
[08:57:59.364]  Cached:    0 cached, 2 total
[08:57:59.364]    Time:    1m39.445s 
[08:57:59.365] Summary:    /vercel/path0/.turbo/runs/2YRrl7mvNitMnNDEJ2jex2PLotR.json
[08:57:59.365]  Failed:    next-app#build
[08:57:59.365] 
[08:57:59.365]  ERROR  run failed: command  exited (1)
[08:57:59.376] Error: Command "turbo run build" exited with 1
[08:58:00.001] 
benschac commented 7 months ago

here's all of the logs from the build

[08:54:51.336] Running build in Washington, D.C., USA (East) – iad1 (Hive)
[08:54:51.446] Cloning github.com/entropyxyz/entropy-client (Branch: 11-15-add_entropyjs_to_home_screen, Commit: fc37d18)
[08:54:52.108] Cloning completed: 662.134ms
[08:55:03.822] Restored build cache
[08:55:03.906] Running "vercel build"
[08:55:04.627] Vercel CLI 32.5.5
[08:55:04.847] > Detected Turbo. Adjusting default settings...
[08:55:05.139] Running "install" command: `yarn set version berry && yarn install`...
[08:55:06.032] ➤ YN0000: Downloading https://repo.yarnpkg.com/4.0.2/packages/yarnpkg-cli/bin/yarn.js
[08:55:06.104] ➤ YN0000: Saving the new release in ../../.yarn/releases/yarn-4.0.2.cjs
[08:55:06.185] ➤ YN0000: Done in 0s 154ms
[08:55:06.970] ➤ YN0000: · Yarn 4.0.2
[08:55:06.971] ➤ YN0000: ┌ Project validation
[08:55:06.972] ➤ YN0057: │ expo-app: Resolutions field will be ignored
[08:55:06.972] ➤ YN0000: └ Completed
[08:55:06.987] ➤ YN0000: ┌ Resolution step
[08:55:07.922] ➤ YN0000: └ Completed in 0s 934ms
[08:55:08.051] ➤ YN0000: ┌ Fetch step
[08:56:01.355] ➤ YN0000: └ Completed in 53s 303ms
[08:56:01.476] ➤ YN0000: ┌ Link step
[08:56:05.411] ➤ YN0007: │ entropy-client@workspace:. must be built because it never has been before or the last one failed
[08:56:05.419] ➤ YN0007: │ @shopify/react-native-skia@npm:0.1.196 [72208] must be built because it never has been before or the last one failed
[08:56:05.420] ➤ YN0007: │ esbuild@npm:0.19.6 must be built because it never has been before or the last one failed
[08:56:05.420] ➤ YN0007: │ esbuild@npm:0.14.47 must be built because it never has been before or the last one failed
[08:56:05.421] ➤ YN0007: │ esbuild@npm:0.19.5 must be built because it never has been before or the last one failed
[08:56:05.421] ➤ YN0007: │ @substrate/connect@npm:0.7.33 must be built because it never has been before or the last one failed
[08:56:06.743] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Updating symlinks for Android build...
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to api /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to jsi /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to rnskia /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to skia /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to utils /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[08:56:06.744] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Symlinks created successfully.
[08:56:09.055] ➤ YN0000: │ entropy-client@workspace:. STDOUT $ npx tsc --baseUrl . --outDir types --rootDir src --emitDeclarationOnly --declarationMap
[08:56:19.166] ➤ YN0000: │ entropy-client@workspace:. STDOUT built @my/ui in 10120 ms
[08:56:19.171] ➤ YN0000: │ entropy-client@workspace:. STDOUT Done in 10s 597ms
[08:56:19.204] ➤ YN0000: └ Completed in 17s 728ms
[08:56:19.503] ➤ YN0000: · Done with warnings in 1m 13s
[08:56:19.847] Detected Next.js version: 13.5.6
[08:56:19.847] Running "turbo run build"
[08:56:20.104] • Packages in scope: next-app
[08:56:20.105] • Running build in 1 packages
[08:56:20.105] • Remote caching enabled
[08:56:21.264] @my/ui:build: cache miss, executing 6260b0d6c5d70f74
[08:56:22.274] @my/ui:build: $ npx tsc --baseUrl . --outDir types --rootDir src --emitDeclarationOnly --declarationMap
[08:56:30.711] @my/ui:build: built @my/ui in 8463 ms
[08:56:30.837] next-app:build: cache miss, executing 2d432234b7ec0451
[08:56:33.705] next-app:build: $ npx tsc --baseUrl . --outDir types --rootDir src --emitDeclarationOnly --declarationMap
[08:56:42.028] next-app:build: built @my/ui in 8350 ms
[08:56:42.038] next-app:build: Done in 8s 844ms
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: Welcome to Tamagui!
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: You can update this monorepo to the latest Tamagui release just by running:
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: yarn upgrade:tamagui
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: We've set up a few things for you.
[08:56:43.208] next-app:build: 
[08:56:43.208] next-app:build: See the "excludeReactNativeWebExports" setting in next.config.js, which omits these
[08:56:43.208] next-app:build: from the bundle: Switch, ProgressBar Picker, CheckBox, Touchable. To save more,
[08:56:43.208] next-app:build: you can add ones you don't need like: AnimatedFlatList, FlatList, SectionList,
[08:56:43.209] next-app:build: VirtualizedList, VirtualizedSectionList.
[08:56:43.209] next-app:build: 
[08:56:43.209] next-app:build: Even better, enable "useReactNativeWebLite" and you can remove the
[08:56:43.209] next-app:build: excludeReactNativeWebExports setting altogether and get tree-shaking and
[08:56:43.209] next-app:build: concurrent mode support as well.
[08:56:43.209] next-app:build: 
[08:56:43.209] next-app:build: 🐣
[08:56:43.209] next-app:build: 
[08:56:43.209] next-app:build: Remove this log in next.config.js.
[08:56:43.209] next-app:build: 
[08:56:43.209] next-app:build: 
[08:56:43.363] next-app:build:    Skipping validation of types
[08:56:43.363] next-app:build:    Linting ...
[08:56:44.944] next-app:build:    Creating an optimized production build ...
[08:56:45.176] next-app:build:    Disabled SWC as replacement for Babel because of custom Babel configuration "babel.config.js" https://nextjs.org/docs/messages/swc-disabled
[08:56:46.390] next-app:build: 
[08:56:46.390] next-app:build:     ➡ [tamagui] built config and components (964ms):
[08:56:46.390] next-app:build: 
[08:56:46.390] next-app:build:         Config     ./.tamagui/tamagui.config.cjs
[08:56:46.390] next-app:build:         Components ./.tamagui/tamagui-components.config.cjs
[08:56:46.390] next-app:build:              ./.tamagui/myui-components.config.cjs
[08:56:46.390] next-app:build:         
[08:56:47.068] next-app:build:     ➡ [tamagui] output css: ./public/tamagui.css
[08:56:47.068] next-app:build: 
[08:56:48.701] next-app:build:    Using external babel configuration from /vercel/path0/apps/next/babel.config.js
[08:56:49.660] next-app:build:  web  |                    screen   ·    4 found   ·    2 opt   ·    1 flat    39ms 
[08:56:49.976] next-app:build:  web  |                    screen   ·   15 found   ·   13 opt   ·   14 flat   188ms 
[08:56:51.860] next-app:build:  web  |              FunctionCard   ·    4 found   ·    3 opt   ·    2 flat    20ms 
[08:56:51.860] next-app:build:  web  |               EntropyLogo   ·    1 found   ·    0 opt   ·    1 flat    19ms 
[08:56:54.216] next-app:build:  web  |               NativeToast   ·    1 found   ·    0 opt   ·    1 flat     9ms 
[08:56:55.905] next-app:build:  web  |               FormWrapper   ·    4 found   ·    3 opt   ·    0 flat    10ms 
[08:57:15.292] next-app:build:  web  |                    screen   ·    4 found   ·    2 opt   ·    1 flat    73ms 
[08:57:15.294] next-app:build:  web  |                    screen   ·   15 found   ·   13 opt   ·   14 flat    72ms 
[08:57:16.429] next-app:build:  web  |              FunctionCard   ·    4 found   ·    3 opt   ·    2 flat    16ms 
[08:57:16.430] next-app:build:  web  |               EntropyLogo   ·    1 found   ·    0 opt   ·    1 flat    17ms 
[08:57:17.567] next-app:build:  web  |               NativeToast   ·    1 found   ·    0 opt   ·    1 flat    15ms 
[08:57:17.568] next-app:build:  web  |               FormWrapper   ·    4 found   ·    3 opt   ·    0 flat    15ms 
[08:57:47.941] next-app:build:  ✓ Compiled successfully
[08:57:47.942] next-app:build:    Collecting page data ...
[08:57:49.852] next-app:build: @polkadot/keyring has multiple versions, ensure that there is only one installed.
[08:57:49.852] next-app:build: Either remove and explicitly install matching versions or dedupe using your package manager.
[08:57:49.852] next-app:build: The following conflicting packages were found:
[08:57:49.852] next-app:build:  cjs 12.5.1  node_modules/@polkadot/keyring/cjs
[08:57:49.852] next-app:build:  esm 12.5.1  <unknown>
[08:57:50.258] next-app:build:    Generating static pages (0/4) ...
[08:57:52.302] next-app:build: 
   Generating static pages (1/4) 
[08:57:52.303] next-app:build: 2023-11-20 16:57:50          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
[08:57:52.303] next-app:build: node:internal/process/promises:288
[08:57:52.303] next-app:build:             triggerUncaughtException(err, true /* fromPromise */);
[08:57:52.303] next-app:build:             ^
[08:57:52.303] next-app:build: 
[08:57:52.303] next-app:build: [UnhandledPromiseRejection: 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(). The promise rejected with the reason "#<ErrorEvent>".] {
[08:57:52.303] next-app:build:   code: 'ERR_UNHANDLED_REJECTION'
[08:57:52.303] next-app:build: }
[08:57:52.303] next-app:build: 
[08:57:52.303] next-app:build: Node.js v18.17.1
[08:57:52.375] next-app:build: Static worker unexpectedly exited with code: 1 and signal: null
[08:57:52.386] next-app:build: 
   Generating static pages (2/4) 
[08:57:52.387] next-app:build: 
   Generating static pages (3/4) 
[08:57:53.997] next-app:build: @polkadot/keyring has multiple versions, ensure that there is only one installed.
[08:57:53.997] next-app:build: Either remove and explicitly install matching versions or dedupe using your package manager.
[08:57:53.997] next-app:build: The following conflicting packages were found:
[08:57:53.997] next-app:build:  cjs 12.5.1  node_modules/@polkadot/keyring/cjs
[08:57:53.997] next-app:build:  esm 12.5.1  <unknown>
[08:57:54.115] next-app:build: 2023-11-20 16:57:54          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
[08:57:54.115] next-app:build: node:internal/process/promises:288
[08:57:54.115] next-app:build:             triggerUncaughtException(err, true /* fromPromise */);
[08:57:54.115] next-app:build:             ^
[08:57:54.115] next-app:build: 
[08:57:54.115] next-app:build: [UnhandledPromiseRejection: 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(). The promise rejected with the reason "#<ErrorEvent>".] {
[08:57:54.115] next-app:build:   code: 'ERR_UNHANDLED_REJECTION'
[08:57:54.115] next-app:build: }
[08:57:54.115] next-app:build: 
[08:57:54.115] next-app:build: Node.js v18.17.1
[08:57:55.800] next-app:build: @polkadot/keyring has multiple versions, ensure that there is only one installed.
[08:57:55.800] next-app:build: Either remove and explicitly install matching versions or dedupe using your package manager.
[08:57:55.800] next-app:build: The following conflicting packages were found:
[08:57:55.800] next-app:build:  cjs 12.5.1  node_modules/@polkadot/keyring/cjs
[08:57:55.800] next-app:build:  esm 12.5.1  <unknown>
[08:57:56.504] next-app:build: 2023-11-20 16:57:56          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
[08:57:56.505] next-app:build: node:internal/process/promises:288
[08:57:56.505] next-app:build:             triggerUncaughtException(err, true /* fromPromise */);
[08:57:56.505] next-app:build:             ^
[08:57:56.505] next-app:build: 
[08:57:56.505] next-app:build: [UnhandledPromiseRejection: 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(). The promise rejected with the reason "#<ErrorEvent>".] {
[08:57:56.505] next-app:build:   code: 'ERR_UNHANDLED_REJECTION'
[08:57:56.505] next-app:build: }
[08:57:56.505] next-app:build: 
[08:57:56.505] next-app:build: Node.js v18.17.1
[08:57:58.416] next-app:build: @polkadot/keyring has multiple versions, ensure that there is only one installed.
[08:57:58.416] next-app:build: Either remove and explicitly install matching versions or dedupe using your package manager.
[08:57:58.416] next-app:build: The following conflicting packages were found:
[08:57:58.416] next-app:build:  cjs 12.5.1  node_modules/@polkadot/keyring/cjs
[08:57:58.416] next-app:build:  esm 12.5.1  <unknown>
[08:57:59.077] next-app:build: 2023-11-20 16:57:58          API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure
[08:57:59.078] next-app:build: node:internal/process/promises:288
[08:57:59.078] next-app:build:             triggerUncaughtException(err, true /* fromPromise */);
[08:57:59.078] next-app:build:             ^
[08:57:59.078] next-app:build: 
[08:57:59.078] next-app:build: [UnhandledPromiseRejection: 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(). The promise rejected with the reason "#<ErrorEvent>".] {
[08:57:59.078] next-app:build:   code: 'ERR_UNHANDLED_REJECTION'
[08:57:59.078] next-app:build: }
[08:57:59.078] next-app:build: 
[08:57:59.078] next-app:build: Node.js v18.17.1
[08:57:59.169] next-app:build: 
[08:57:59.169] next-app:build: > Build error occurred
[08:57:59.171] next-app:build: Error: Jest worker encountered 4 child process exceptions, exceeding retry limit
[08:57:59.171] next-app:build:     at ChildProcessWorker.initialize (/vercel/path0/node_modules/next/dist/compiled/jest-worker/index.js:1:11580)
[08:57:59.172] next-app:build:     at ChildProcessWorker._onExit (/vercel/path0/node_modules/next/dist/compiled/jest-worker/index.js:1:12545)
[08:57:59.172] next-app:build:     at ChildProcess.emit (node:events:514:28)
[08:57:59.172] next-app:build:     at ChildProcess.emit (node:domain:489:12)
[08:57:59.172] next-app:build:     at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
[08:57:59.172] next-app:build:   type: 'WorkerError'
[08:57:59.172] next-app:build: }
[08:57:59.363] next-app:build: ERROR: command finished with error: command (/vercel/path0/apps/next) yarn run build exited (1)
[08:57:59.363] next-app#build: command (/vercel/path0/apps/next) yarn run build exited (1)
[08:57:59.364] 
[08:57:59.364]   Tasks:    1 successful, 2 total
[08:57:59.364]  Cached:    0 cached, 2 total
[08:57:59.364]    Time:    1m39.445s 
[08:57:59.365] Summary:    /vercel/path0/.turbo/runs/2YRrl7mvNitMnNDEJ2jex2PLotR.json
[08:57:59.365]  Failed:    next-app#build
[08:57:59.365] 
[08:57:59.365]  ERROR  run failed: command  exited (1)
[08:57:59.376] Error: Command "turbo run build" exited with 1
[08:58:00.001] 
benschac commented 7 months ago

last passing build for reference:

[06:51:14.396] Running build in Washington, D.C., USA (East) – iad1 (Hive)
[06:51:14.498] Cloning github.com/entropyxyz/entropy-client (Branch: main, Commit: 8f32538)
[06:51:14.817] Previous build cache not available
[06:51:15.163] Cloning completed: 665.18ms
[06:51:15.405] Running "vercel build"
[06:51:15.900] Vercel CLI 32.5.3
[06:51:16.049] > Detected Turbo. Adjusting default settings...
[06:51:16.237] Running "install" command: `yarn set version berry && yarn install`...
[06:51:17.104] ➤ YN0000: Downloading https://repo.yarnpkg.com/4.0.1/packages/yarnpkg-cli/bin/yarn.js
[06:51:17.178] ➤ YN0000: Saving the new release in ../../.yarn/releases/yarn-4.0.1.cjs
[06:51:17.187] ➤ YN0000: Done in 0s 83ms
[06:51:17.846] ➤ YN0000: · Yarn 4.0.1
[06:51:17.847] ➤ YN0000: ┌ Project validation
[06:51:17.847] ➤ YN0057: │ expo-app: Resolutions field will be ignored
[06:51:17.847] ➤ YN0000: └ Completed
[06:51:17.860] ➤ YN0000: ┌ Resolution step
[06:51:18.459] ➤ YN0000: └ Completed in 0s 598ms
[06:51:18.562] ➤ YN0000: ┌ Fetch step
[06:52:07.592] ➤ YN0000: └ Completed in 49s 29ms
[06:52:07.703] ➤ YN0000: ┌ Link step
[06:52:33.095] ➤ YN0007: │ entropy-client@workspace:. must be built because it never has been before or the last one failed
[06:52:33.101] ➤ YN0007: │ @shopify/react-native-skia@npm:0.1.196 [72208] must be built because it never has been before or the last one failed
[06:52:33.102] ➤ YN0007: │ esbuild@npm:0.14.47 must be built because it never has been before or the last one failed
[06:52:33.102] ➤ YN0007: │ esbuild@npm:0.19.5 must be built because it never has been before or the last one failed
[06:52:33.102] ➤ YN0007: │ @substrate/connect@npm:0.7.33 must be built because it never has been before or the last one failed
[06:52:33.993] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Updating symlinks for Android build...
[06:52:33.993] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to api /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[06:52:33.994] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to jsi /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[06:52:33.994] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to rnskia /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[06:52:33.995] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to skia /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[06:52:33.995] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Creating symlink to utils /vercel/path0/node_modules/@shopify/react-native-skia/scripts /vercel/path0/node_modules/@shopify/react-native-skia
[06:52:33.995] ➤ YN0000: │ @shopify/react-native-skia@npm:0.1.196 [72208] STDOUT Symlinks created successfully.
[06:52:36.411] ➤ YN0000: │ entropy-client@workspace:. STDOUT $ npx tsc --baseUrl . --outDir types --rootDir src --emitDeclarationOnly --declarationMap
[06:52:44.894] ➤ YN0000: │ entropy-client@workspace:. STDOUT built @my/ui in 8497 ms
[06:52:44.901] ➤ YN0000: │ entropy-client@workspace:. STDOUT Done in 8s 958ms
[06:52:44.930] ➤ YN0000: └ Completed in 37s 226ms
[06:52:45.199] ➤ YN0000: · Done with warnings in 1m 28s
[06:52:45.479] Detected Next.js version: 13.5.6
[06:52:45.479] Running "turbo run build"
[06:52:45.684] • Packages in scope: next-app
[06:52:45.684] • Running build in 1 packages
[06:52:45.684] • Remote caching enabled
[06:52:45.792] @my/ui:build: cache miss, executing 6260b0d6c5d70f74
[06:52:46.709] @my/ui:build: $ npx tsc --baseUrl . --outDir types --rootDir src --emitDeclarationOnly --declarationMap
[06:52:54.530] @my/ui:build: built @my/ui in 7843 ms
[06:52:54.718] next-app:build: cache miss, executing 7e0bf4428d1993d8
[06:52:57.328] next-app:build: $ npx tsc --baseUrl . --outDir types --rootDir src --emitDeclarationOnly --declarationMap
[06:53:05.292] next-app:build: built @my/ui in 7990 ms
[06:53:05.299] next-app:build: Done in 8s 405ms
[06:53:06.424] next-app:build: 
[06:53:06.425] next-app:build: 
[06:53:06.425] next-app:build: Welcome to Tamagui!
[06:53:06.425] next-app:build: 
[06:53:06.425] next-app:build: You can update this monorepo to the latest Tamagui release just by running:
[06:53:06.425] next-app:build: 
[06:53:06.425] next-app:build: yarn upgrade:tamagui
[06:53:06.425] next-app:build: 
[06:53:06.425] next-app:build: We've set up a few things for you.
[06:53:06.425] next-app:build: 
[06:53:06.425] next-app:build: See the "excludeReactNativeWebExports" setting in next.config.js, which omits these
[06:53:06.425] next-app:build: from the bundle: Switch, ProgressBar Picker, CheckBox, Touchable. To save more,
[06:53:06.425] next-app:build: you can add ones you don't need like: AnimatedFlatList, FlatList, SectionList,
[06:53:06.425] next-app:build: VirtualizedList, VirtualizedSectionList.
[06:53:06.425] next-app:build: 
[06:53:06.425] next-app:build: Even better, enable "useReactNativeWebLite" and you can remove the
[06:53:06.425] next-app:build: excludeReactNativeWebExports setting altogether and get tree-shaking and
[06:53:06.425] next-app:build: concurrent mode support as well.
[06:53:06.425] next-app:build: 
[06:53:06.426] next-app:build: 🐣
[06:53:06.426] next-app:build: 
[06:53:06.426] next-app:build: Remove this log in next.config.js.
[06:53:06.426] next-app:build: 
[06:53:06.426] next-app:build: 
[06:53:06.453] next-app:build: Attention: Next.js now collects completely anonymous telemetry regarding usage.
[06:53:06.453] next-app:build: This information is used to shape Next.js' roadmap and prioritize features.
[06:53:06.453] next-app:build: You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[06:53:06.453] next-app:build: https://nextjs.org/telemetry
[06:53:06.453] next-app:build: 
[06:53:06.588] next-app:build:    Skipping validation of types
[06:53:06.589] next-app:build:    Linting ...
[06:53:08.060] next-app:build:    Creating an optimized production build ...
[06:53:08.285] next-app:build:    Disabled SWC as replacement for Babel because of custom Babel configuration "babel.config.js" https://nextjs.org/docs/messages/swc-disabled
[06:53:09.111] next-app:build: 
[06:53:09.111] next-app:build:     ➡ [tamagui] built config and components (585ms):
[06:53:09.111] next-app:build: 
[06:53:09.111] next-app:build:         Config     ./.tamagui/tamagui.config.cjs
[06:53:09.111] next-app:build:         Components ./.tamagui/tamagui-components.config.cjs
[06:53:09.111] next-app:build:              ./.tamagui/myui-components.config.cjs
[06:53:09.112] next-app:build:         
[06:53:09.741] next-app:build:     ➡ [tamagui] output css: ./public/tamagui.css
[06:53:09.741] next-app:build: 
[06:53:09.964] next-app:build:    Using external babel configuration from /vercel/path0/apps/next/babel.config.js
[06:53:11.021] next-app:build:  web  |                    screen   ·    4 found   ·    2 opt   ·    1 flat   182ms 
[06:53:11.027] next-app:build:  web  |                    screen   ·   15 found   ·   13 opt   ·   14 flat   186ms 
[06:53:12.901] next-app:build:  web  |               EntropyLogo   ·    1 found   ·    0 opt   ·    1 flat    24ms 
[06:53:12.903] next-app:build:  web  |              FunctionCard   ·    4 found   ·    3 opt   ·    2 flat    26ms 
[06:53:14.584] next-app:build:  web  |               NativeToast   ·    1 found   ·    0 opt   ·    1 flat     7ms 
[06:53:16.397] next-app:build:  web  |               FormWrapper   ·    4 found   ·    3 opt   ·    0 flat    13ms 
[06:53:31.526] next-app:build:  web  |                    screen   ·    4 found   ·    2 opt   ·    1 flat    69ms 
[06:53:31.529] next-app:build:  web  |                    screen   ·   15 found   ·   13 opt   ·   14 flat    70ms 
[06:53:32.817] next-app:build:  web  |              FunctionCard   ·    4 found   ·    3 opt   ·    2 flat    63ms 
[06:53:32.818] next-app:build:  web  |               EntropyLogo   ·    1 found   ·    0 opt   ·    1 flat    63ms 
[06:53:34.687] next-app:build:  web  |               NativeToast   ·    1 found   ·    0 opt   ·    1 flat    38ms 
[06:53:34.687] next-app:build:  web  |               FormWrapper   ·    4 found   ·    3 opt   ·    0 flat    37ms 
[06:53:55.618] next-app:build:  ✓ Compiled successfully
[06:53:55.619] next-app:build:    Collecting page data ...
[06:53:57.219] next-app:build:    Generating static pages (0/4) ...
[06:53:59.021] next-app:build: 
   Generating static pages (1/4) 
[06:53:59.021] next-app:build: 
   Generating static pages (2/4) 
[06:53:59.023] next-app:build: 
   Generating static pages (3/4) 
[06:54:00.194] next-app:build: 
 ✓ Generating static pages (4/4) 
[06:54:00.712] next-app:build:    Finalizing page optimization ...
[06:54:00.713] next-app:build:    Collecting build traces ...
[06:54:09.733] next-app:build: 
[06:54:09.738] next-app:build: Route (pages)                              Size     First Load JS
[06:54:09.738] next-app:build: ┌ ○ /                                      4.71 kB         424 kB
[06:54:09.738] next-app:build: ├   └ css/a562fea1293b4a14.css             511 B
[06:54:09.738] next-app:build: ├   /_app                                  0 B             409 kB
[06:54:09.738] next-app:build: ├ ○ /404                                   1.45 kB         410 kB
[06:54:09.739] next-app:build: └ ○ /settings (502 ms)                     8.97 kB         428 kB
[06:54:09.739] next-app:build:     └ css/7d5905b3efb869fe.css             746 B
[06:54:09.739] next-app:build: + First Load JS shared by all              700 kB
[06:54:09.739] next-app:build:   ├ chunks/framework-9f6c9febb0f7d2db.js   45.3 kB
[06:54:09.739] next-app:build:   ├ chunks/main-327df458a4c42f0a.js        39.7 kB
[06:54:09.739] next-app:build:   ├ chunks/pages/_app-da2c3fca83007cc1.js  322 kB
[06:54:09.739] next-app:build:   ├ chunks/webpack-c6733ec6d41a4a7f.js     1.94 kB
[06:54:09.739] next-app:build:   └ css/8f811f30b3f2e216.css               291 kB
[06:54:09.739] next-app:build: 
[06:54:09.739] next-app:build: ○  (Static)  automatically rendered as static HTML (uses no initial props)
[06:54:09.739] next-app:build: 
[06:54:09.853] 
[06:54:09.853]   Tasks:    2 successful, 2 total
[06:54:09.853]  Cached:    0 cached, 2 total
[06:54:09.853]    Time:    1m24.309s 
[06:54:09.853] Summary:    /vercel/path0/.turbo/runs/2Y51jzvjf8W8dO5X6VGczdq01T3.json
[06:54:09.854] 
[06:54:10.091] Collected static files (public/, static/, .next/static): 3.929ms
[06:54:10.102] Build Completed in /vercel/output [3m]
[06:54:10.204] Deploying outputs...
[06:54:11.737] 
[06:54:11.988] Deployment completed
[06:54:38.386] Uploading build cache [283.19 MB]...
[06:54:45.331] Build cache uploaded: 6.945s
benschac commented 7 months ago

Looking at this again with a fresh set of eyes after 3 weeks:

Module for executing heavy tasks under forked processes in parallel, by providing a Promise based interface, minimum overhead, and bound workers.

The module works by providing an absolute path of the module to be loaded in all forked processes. All methods are exposed on the parent process as promises, so they can be await'ed. Child (worker) methods can either be synchronous or asynchronous.

Issue isn't a test being run, but an API requests entropyjs can't make.

Can see the build failing / erroring for times before seeing the last jest-worker error log.

Failures are coming from entropy-js which makes sense, it's the only thing that's trying to make an API call, and should have it's errors swallowed / handled gracefully.

entropyjs is trying to hit this URL: next-app:build: 2023-12-05 23:49:10 API-WS: disconnected from ws://127.0.0.1:9944: 1006:: Abnormal Closure which doesn't exist.

https://github.com/entropyxyz/entropy-js/blob/4855cd8f38cf93980c052106c75fbcb285c2709c/src/utils/index.ts#L50

is the only reference to port 9944.

It would be helpful to have some kind of check here like

const env = process.env.NODE_ENV === 'production'
if (env &&  endpoint === 'ws://127.0.0.1:9944') {

   throw Error('Provide Network URL in production')
}

or something like that.