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

Cannot read properties of undefined (reading 'extends') #8435

Closed
ficristo opened this issue Aug 29, 2024 · 4 comments
Closed

Cannot read properties of undefined (reading 'extends') #8435

ficristo opened this issue Aug 29, 2024 · 4 comments

Comments

@ficristo
Copy link

  • Electron-Builder Version: 25.0.5
  • Node Version: 20.16.0
  • Electron Version: 31.4.0
  • Electron Type (current, beta, nightly): current
  • Target: all

I wanted to move the configuration of electron-builder from package.json to a typescript file named electron-builder.ts.
Running the script electron-builder --dir throws the following error:
Cannot read properties of undefined (reading 'extends')
I tried to rename the config file but had the same error.
See also:
quadre-code/quadre@9c02b17
https://github.com/quadre-code/quadre/actions/runs/10614792861/job/29421489405

Using the js version seems to work (just needs to have a differente name from the default).

@mmaietta
Copy link
Collaborator

mmaietta commented Sep 5, 2024

Can you try using export default instead of module.exports?

This is how I've set up the typescript config file for my test project. Wondering if the satifies Configuration is causing the subdependency read-config-file (or internally the https://www.npmjs.com/package/config-file-ts package) to throw the error.

import { Configuration } from "app-builder-lib"

const options: Configuration = {
    // options
};

export default options;

@ficristo
Copy link
Author

ficristo commented Sep 7, 2024

@mmaietta thank you!
It worked quadre-code/quadre@b07a2c8
I just used the Configuration type from electron-builder instead of app-builder-lib.

I would be nice to add this to the documentation and how to add the types in the jsdoc comment in a js file.
Also it seems that the configuration file can be something like electron-builder.config.ts even without using the --config command.

@mmaietta
Copy link
Collaborator

mmaietta commented Sep 8, 2024

You mean jsdoc/intellisense like this? https://www.electron.build/api/programmatic-usage

@ficristo
Copy link
Author

ficristo commented Sep 8, 2024

Oh, didn't see that!
I was only looking here https://www.electron.build/configuration/configuration

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

2 participants