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

[Bug?]: getIssuerSpecsFromModule function npe error #6587

Open
1 task done
chenhuang444 opened this issue Nov 3, 2024 · 0 comments
Open
1 task done

[Bug?]: getIssuerSpecsFromModule function npe error #6587

chenhuang444 opened this issue Nov 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@chenhuang444
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

Migrating out Electron app to PnP caused getIssuerSpecsFromModule to throw error on startup.
Image

To reproduce

As I am migrating an existing app to PnP, it is difficult to pinpoint what is causing the crash. However, it seems that null checking module.paths?.length in the first line of getIssuerSpecsFromModule fixes the issue.

Basically:

function getIssuerSpecsFromModule(module: NodeModule | null | undefined): Array<IssuerSpec> {
  if (module && module.id !== `<repl>` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths?.length > 0) {
    // ... stuff
  }

  // ... stuff
}

Environment

System:
OS: macOS 14.5
CPU: (11) arm64 Apple M3 Pro
Binaries:
Node: 18.20.4 - /private/var/folders/mz/x9j10h2j05df1cbkf8kws7t00000gn/T/xfs-bc166754/node
Yarn: 4.5.1 - /private/var/folders/mz/x9j10h2j05df1cbkf8kws7t00000gn/T/xfs-bc166754/yarn
npm: 10.7.0 - ~/.nvm/versions/node/v18.20.4/bin/npm

Additional context

No response

@chenhuang444 chenhuang444 added the bug Something isn't working label Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant