[Bug] the `KintoneRestAPIClient.version` causes an Error on browser environment
Closed this issue · 1 comments
Summary
On the browser environment, KintoneRestAPIClient.version
causes a runtime Error.
Target Package
@kintone/rest-api-client
Target Version
3.3.14
Reproduction
I created the reproduction link:
https://stackblitz.com/edit/bug-kintone-rest-api-client-version?file=index.js
On the Node.js environment and UMD file, the error doesn't happen.
- Node.js environment: https://stackblitz.com/edit/bug-kintone-rest-api-client-version-node-js?file=package.json
- Loading UMD: https://stackblitz.com/edit/bug-kintone-rest-api-client-version-umd?devToolsHeight=33&file=index.html
Expected Behavior
KintoneRestAPIClient.version
should show the correct version of @kintone/rest-api-client
Actual Behavior
Accessing KintoneRestAPIClient.version
causes an error
PACKAGE_VERSION is not defined
On the browser platform, KintoneRestAPIClient.version
returns PACKAGE_VERSION
that is not defined.
https://github.com/kintone/js-sdk/blob/master/packages/rest-api-client/src/platform/browser.ts#L67
On UMD, the PACKAGE_VERSION
is replaced with the version value during the build process.
https://github.com/kintone/js-sdk/blob/master/packages/rest-api-client/rollup.config.mjs#L93
On the Node.js platform, KintoneRestAPIClient.version
returns version
from package.json.
https://github.com/kintone/js-sdk/blob/master/packages/rest-api-client/src/platform/node.ts#L80
Environment
N/A