Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: use correct version IPFS version number #3534

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion packages/ipfs-core/src/components/version.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const pkg = require('../../package.json')
const pkg = require('../../../ipfs/package.json')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail at runtime as it traverses outside of the module folder. E.g. if you only have ipfs-core installed (e.g. your app is running an in-process IPFS node and you don't need a CLI/HTTP API server/daemon, etc).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better solution may be to have the build write a version file out at build time with the version number, git hash, etc, then we can try to load it here. It would also mean that the whole package.json doesn't get included in the browser bundle which would be a nice side benefit.

const withTimeoutOption = require('ipfs-core-utils/src/with-timeout-option')

/**
Expand Down