#16055·jupyterlab

`after:publish:assets` fails when releasing a new version including new packages not previously published on npm

Author: krassowskiCreated Mar 25, 2024Updated Sep 10, 2026
Labelsbug

e.g.

Publishing 4.2.0a2 failed: Package `@jupyterlab/workspaces` could not be found

https://github.com/jupyterlab/jupyterlab/actions/runs/8419375002/job/23051846349

The new @jupyterlab/workspaces was successfully published to npm: https://www.npmjs.com/package/@jupyterlab/workspaces

Handling dist file dist/jupyterlab-workspaces-4.2.0-alpha.2.tgz
COMMAND: npm publish --tag next jupyterlab-workspaces-4.2.0-alpha.2.tgz
Handling dist file dist/jupyterlab-workspaces-extension-4.2.0-alpha.2.tgz
COMMAND: npm publish --tag next jupyterlab-workspaces-extension-4.2.0-alpha.2.tgz
Handling dist file dist/metadata.json
Nothing to upload for metadata.json

but in the subsequent step of after:publish:assets, the CI failed with:

Running hooks for after-publish-assets
> @jupyterlab/[email protected] after:publish:assets
> jlpm && npm run build:utils && node buildutils/lib/publish --skip-publish

➤ YN0000: ┌ Project validation
Project validation
➤ YN0000: └ Completed
➤ YN0000: ┌ Resolution step
Resolution step
➤ YN0000: └ Completed in 0s 408ms
➤ YN0000: ┌ Fetch step
Fetch step
➤ YN0000: └ Completed in 0s 528ms
➤ YN0000: ┌ Link step
Link step
➤ YN0000: └ Completed in 0s 750ms
➤ YN0000: Done with warnings in 1s 825ms

> @jupyterlab/[email protected] build:utils
> cd buildutils && npm run build


> @jupyterlab/[email protected] build
> tsc && cd template && npm run build


> @jupyterlab/[email protected] build
> tsc -b

Uncaught exception PackageNotFoundError: Package `@jupyterlab/workspaces` could not be found
    at packageJson (/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/node_modules/package-json/index.js:72:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handlePackage (/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/buildutils/lib/update-dist-tag.js:58:21)
    at async Promise.all (index 120)
    at async Command.<anonymous> (/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/buildutils/lib/publish.js:94:22)
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.8/x64/bin/jupyter-releaser", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/cli.py", line 139, in invoke
    util.run(hook)
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/util.py", line 94, in run
    raise e
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/util.py", line 86, in run
    process = tee(cmd, **kwargs)
              ^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/tee.py", line 159, in run
    raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command 'npm run after:publish:assets' returned non-zero exit status 1.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/actions/finalize_release.py", line 15, in <module>
    run_action("jupyter-releaser publish-assets")
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/actions/common.py", line 25, in run_action
    _run(target, *args, **kwargs)
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/util.py", line 94, in run
    raise e
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/util.py", line 86, in run
    process = tee(cmd, **kwargs)
              ^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/tee.py", line 159, in run
    raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command 'jupyter-releaser publish-assets' returned non-zero exit status 1.

I wonder if this was just an issue of a delay between the npm upload and the artefact becoming available?