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

CI is broken #282

Closed
twoeths opened this issue Jun 15, 2022 · 4 comments
Closed

CI is broken #282

twoeths opened this issue Jun 15, 2022 · 4 comments

Comments

@twoeths
Copy link
Contributor

twoeths commented Jun 15, 2022

CI is broken with this error

Test Browser
- Setting up chromium
Playwright build of chromium v978106 downloaded to /home/runner/.cache/ms-playwright/chromium-978106
Playwright build of ffmpeg v1007 downloaded to /home/runner/.cache/ms-playwright/ffmpeg-1007
✔ chromium set up
Error: R] Could not resolve "mocha/mocha-es2018.js"
    node_modules/playwright-test/src/setup-mocha.js:6:18:
      6 │ import mocha from 'mocha/mocha-es2018.js'
        ╵                   ~~~~~~~~~~~~~~~~~~~~~~~
  You can mark the path "mocha/mocha-es2018.js" as external to exclude it from the bundle, which will remove this error.
✖ Running tests failed.
Error: Build failed with 1 error:
node_modules/playwright-test/src/setup-mocha.js:6:18: ERROR: Could not resolve "mocha/mocha-es2018.js"
    at failureErrorWithLog (/home/runner/work/js-libp2p-gossipsub/js-libp2p-gossipsub/node_modules/playwright-test/node_modules/esbuild/lib/main.js:1599:15)
    at /home/runner/work/js-libp2p-gossipsub/js-libp2p-gossipsub/node_modules/playwright-test/node_modules/esbuild/lib/main.js:1[24](https://github.com/ChainSafe/js-libp2p-gossipsub/runs/6895375292?check_suite_focus=true#step:5:25)5:28
    at runOnEndCallbacks (/home/runner/work/js-libp2p-gossipsub/js-libp2p-gossipsub/node_modules/playwright-test/node_modules/esbuild/lib/main.js:1030:63)
    at buildResponseToResult (/home/runner/work/js-libp2p-gossipsub/js-libp2p-gossipsub/node_modules/playwright-test/node_modules/esbuild/lib/main.js:1243:7)
    at /home/runner/work/js-libp2p-gossipsub/js-libp2p-gossipsub/node_modules/playwright-test/node_modules/esbuild/lib/main.js:1352:14
    at /home/runner/work/js-libp2p-gossipsub/js-libp2p-gossipsub/node_modules/playwright-test/node_modules/esbuild/lib/main.js:662:9
    at handleIncomingPacket (/home/runner/work/js-libp2p-gossipsub/js-libp2p-gossipsub/node_modules/playwright-test/node_modules/esbuild/lib/main.js:759:9)
    at Socket.readFromStdout (/home/runner/work/js-libp2p-gossipsub/js-libp2p-gossipsub/node_modules/playwright-test/node_modules/esbuild/lib/main.js:629:7)
    at Socket.emit (node:events:5[27](https://github.com/ChainSafe/js-libp2p-gossipsub/runs/6895375292?check_suite_focus=true#step:5:28):[28](https://github.com/ChainSafe/js-libp2p-gossipsub/runs/6895375292?check_suite_focus=true#step:5:29))
    at addChunk (node:internal/streams/readable:[31](https://github.com/ChainSafe/js-libp2p-gossipsub/runs/6895375292?check_suite_focus=true#step:5:32)5:12) {
  errors: [
    {
      detail: undefined,
      location: [Object],
      notes: [Array],
      pluginName: '',
      text: 'Could not resolve "mocha/mocha-es2018.js"'
    }
  ],
  warnings: []
}
Command failed with exit code 1: pw-test ./dist/test/*.spec.js --mode main --config /home/runner/work/js-libp2p-gossipsub/js-libp2p-gossipsub/node_modules/aegir/src/config/pw-test.js --exit --timeout=60000 --bail
@twoeths
Copy link
Contributor Author

twoeths commented Jun 15, 2022

I cannot reproduce in my local environment, I wonder it's due to some dependencies updated? @achingbrain @wemeetagain should we upgrade aegir to latest version?

@wemeetagain
Copy link
Member

There's a problem updating aegir:

#285
https://github.com/ChainSafe/js-libp2p-gossipsub/runs/6903825497?check_suite_focus=true#step:5:26

> @chainsafe/libp2p-gossipsub@1.1.2 build
> tsc -p tsconfig.build.json
> @chainsafe/libp2p-gossipsub@1.1.2 test
> aegir test -f './dist/test/*.spec.js' "--target" "node" "--cov" "--bail" "--" "--exit"
build
> @chainsafe/libp2p-gossipsub@1.1.2 build
> tsc -p tsconfig.build.json "--no-bundle"
error TS5023: Unknown compiler option '--no-bundle'.

@achingbrain @mpetrunic would appreciate an eye to help unblock this repo

@achingbrain
Copy link
Collaborator

It's expecting the build npm command to be aegir build which supports the --no-bundle flag (may be an overreach, we could not pass the flag in aegir).

I see there are two tsconfig.json files in this repo - if you just have one and use aegir build as your build script as per the convention it'll start to work.

The default tsconfig.json for a typescript project is pretty simple, any extra fields can be PR'd into aegir/src/config/tsconfig.aegir.json (we talked about turning on noImplicitReturns, for example).

@wemeetagain
Copy link
Member

thanks @achingbrain we may PR into aegir with some additional rules

resolved with #285

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

No branches or pull requests

3 participants