paritytech / substrate-api-sidecar

REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.
https://paritytech.github.io/substrate-api-sidecar/dist/
GNU General Public License v3.0
244 stars 151 forks source link

Sidecar v8.0.1 global package error. #598

Closed TarikGul closed 3 years ago

TarikGul commented 3 years ago
tariks-mbp:substrate-api-sidecar tarik$ substrate-api-sidecar
/Users/tarik/.nvm/versions/node/v14.15.0/lib/node_modules/@substrate/api-sidecar/node_modules/@polkadot/apps-config/api/spec/crab.cjs:12
var _default = _mix.typesBundleForPolkadot.spec.crab;
                                           ^

TypeError: Cannot read property 'spec' of undefined
    at Object.<anonymous> (/Users/tarik/.nvm/versions/node/v14.15.0/lib/node_modules/@substrate/api-sidecar/node_modules/@polkadot/apps-config/api/spec/crab.cjs:12:44)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/tarik/.nvm/versions/node/v14.15.0/lib/node_modules/@substrate/api-sidecar/node_modules/@polkadot/apps-config/api/spec/index.cjs:40:36)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

To reproduce:

npm install -g @substrate/api-sidecar
substrate-api-sidecar
TarikGul commented 3 years ago

If this error comes up, please revert back to v8.0.0.

TarikGul commented 3 years ago

The Issue

When downloading the global sidecar package there is a peer dependency @darwinia/types which is used in @polkadot/apps-config. The version used in polkadot-js is v1.1.0-alpha.22. 10 hours earlier @darwinia/types@1.1.2 was released which changes the import variables names when it comes to the typesBundle. Even though we are suppose to be using v1.1.0-alpha.22 as a dependency our node_modules in the global package are showing 1.1.2 which reflects that change and breaks our api's package.

TarikGul commented 3 years ago

This PR fixes our release issue regarding the @darwinia/types.

TarikGul commented 3 years ago

Closing due to the packages being fixed, and the above PR being merged in. Seems to have been an NPM problem.