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

fix(node): Electron apps crashing #367

Merged
merged 2 commits into from
Mar 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/platform/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const is_cjs = !meta_url;
const __dirname__ = is_cjs ? __dirname : path.dirname(fileURLToPath(meta_url));

const package_json = JSON.parse(readFileSync(path.resolve(__dirname__, is_cjs ? '../package.json' : '../../package.json'), 'utf-8'));
const repo_url = package_json.homepage?.split('#')[0];

class Cache implements ICache {
#persistent_directory: string;
Expand Down Expand Up @@ -102,8 +103,8 @@ Platform.load({
runtime: 'node',
info: {
version: package_json.version,
bugs_url: package_json.bugs.url,
repo_url: package_json.homepage.split('#')[0]
bugs_url: package_json.bugs?.url || `${repo_url}/issues`,
repo_url
},
server: true,
Cache: Cache,
Expand All @@ -130,4 +131,4 @@ Platform.load({

export * from './lib.js';
import Innertube from './lib.js';
export default Innertube;
export default Innertube;