v22.11.1 intrododuces publishing bug
See original GitHub issueProblem
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:
- Created 2 years ago
- Reactions:11
- Comments:11 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fix:
import * as mime from "mime"
instead ofimport mime from "mime"
. Will be pushed soon.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
inmime
as a default import, but is treatingmodule.exports
as an object of named exports and looking for adefault
property on that object in the published asset. Sincemime
doesn’t export an object with adefault
property, you will see these.default is not a function
errors wherever a cjs module is imported as a default import.The solution is: