question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v22.11.1 intrododuces publishing bug

See original GitHub issue

Problem

Node: 14.16.1 OS: Linux, MacOS

have noticed the following error with publishing builds with v22.11.1 :

> electron-builder --config build/electron-builder.config.js --publish always

  • cannot check updates  error=TypeError: update_notifier_1.default is not a function
  • electron-builder  version=22.10.5 os=5.4.0-72-generic
  • loaded configuration  file=/home/somename/projects/AHAU/whakapapa-ora/desktop/build/electron-builder.config.js
  • writing effective config  file=dist/installers/builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=fd-lock@1.2.0, fsctl@1.0.0, leveldown@5.6.0, sodium-native@3.2.1, utp-native@2.4.0 platform=linux arch=x64
  • packaging       platform=linux arch=x64 electron=12.0.6 appOutDir=dist/installers/linux-unpacked
  • building        target=AppImage arch=x64 file=dist/installers/ahau-desktop-Linux-1.3.1-x86_64.AppImage
  • publishing      publisher=Github (owner: protozoa-nz, project: whakapapa-ora, version: 1.3.1)
  • uploading       file=ahau-desktop-Linux-1.3.1-x86_64.AppImage provider=GitHub
  ⨯ Cannot read property 'getType' of undefined  failedTask=build stackTrace=TypeError: Cannot read property 'getType' of undefined
    at GitHubPublisher.doUploadFile (/home/somename/projects/AHAU/whakapapa-ora/desktop/node_modules/electron-publish/src/gitHubPublisher.ts:190:36)
    at GitHubPublisher.doUpload (/home/somename/projects/AHAU/whakapapa-ora/desktop/node_modules/electron-publish/src/gitHubPublisher.ts:170:23)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at GitHubPublisher.upload (/home/somename/projects/AHAU/whakapapa-ora/desktop/node_modules/electron-publish/src/publisher.ts:87:5)
    at async Promise.all (index 1)
    at AsyncTaskManager.awaitTasks (/home/somename/projects/AHAU/whakapapa-ora/desktop/node_modules/builder-util/src/asyncTaskManager.ts:65:25)
    at PublishManager.awaitTasks (/home/somename/projects/AHAU/whakapapa-ora/desktop/node_modules/app-builder-lib/src/publish/PublishManager.ts:228:5)
    at Object.executeFinally (/home/somename/projects/AHAU/whakapapa-ora/desktop/node_modules/builder-util/src/promise.ts:23:3)

Investigation

Looked at /home/somename/projects/AHAU/whakapapa-ora/desktop/node_modules/electron-publish/src/gitHubPublisher.ts:190:36 and it’s saying mime is undefined which is pretty strange

➜  desktop git:(master) npm ls mime --depth 5
ahau-desktop@1.3.1 /home/somename/projects/AHAU/whakapapa-ora/desktop
├─┬ electron-builder@22.11.1
│ └─┬ app-builder-lib@22.11.1
│   └─┬ electron-publish@22.11.1
│     └── mime@2.5.2 deduped

hmmm

Fix

regress to v22.10.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:11
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
develarcommented, May 10, 2021

Fix: import * as mime from "mime" instead of import mime from "mime". Will be pushed soon.

2reactions
bcomnescommented, May 10, 2021

Could someone please put together a minimal-reproducing repo/gist?

I wrote up the problem in the published package:

https://github.com/electron-userland/electron-builder/pull/5870#issuecomment-836743687

Basically, the tests are treating module.exports in mime as a default import, but is treating module.exports as an object of named exports and looking for a default property on that object in the published asset. Since mime doesn’t export an object with a default property, you will see these .default is not a function errors wherever a cjs module is imported as a default import.

The solution is:

  • make the ts test and publish config consistent somehow (I have no idea)
  • fix the import syntax to match the config
Read more comments on GitHub >

github_iconTop Results From Across the Web

Plugins — Core Lightning v22.11.1-28-g141c836-modded
If there is a conflict then lightningd will report an error and kill the plugin, ... to a common topic and other plugins...
Read more >
What's new in Google System Updates
[Auto, Phone, TV] Bug fixes for Account Management, Security, Stability and Updatability related services. Device Connectivity. [Phone] Update Cast related ...
Read more >
AMD Radeon Software Adrenalin 22.11.1 Released (UPDATED
AMD has published a new version of its graphics driver for Radeon graphics cards. ... Same OpenGL support than v22.11.1
Read more >
Tweets with replies by Teku (@Teku_ConsenSys) / Twitter
Oct 11. Teku v22.10.1 is now available. This is a recommended upgrade containing bug fixes, optimisations and voluntary-exit command improvements The full ...
Read more >
2022 - FingerTec Technical Blog
Thursday, December 01, 2022 TimeTec 0 Comments. Introduction TimeTec Leave New Release v22.11.1.x has introduced us to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found