contentstack / contentstack-javascript

Javascript SDK for Contentstack's Content Delivery API (Nodejs and Browser)
MIT License
27 stars 23 forks source link

@slack/bolt should be in devDependencies #169

Closed sethidden closed 5 months ago

sethidden commented 6 months ago

The usage of @slack/bolt@3.17.1 installs a version that doesn't support Node 16, it was dropped in 3.14.x - https://github.com/slackapi/bolt-js/releases/tag/%40slack%2Fbolt%403.14.0.

On Node 16, this will result in this error:

[2/5] πŸ”  Resolving packages...
verbose 0.269790083 Performing "GET" request to "https://registry.yarnpkg.com/contentstack".
verbose 0.42522025 Request "https://registry.yarnpkg.com/contentstack" finished with status code 200.
verbose 0.427749333 Performing "GET" request to "https://registry.yarnpkg.com/@slack%2fbolt".
verbose 0.498153625 Request "https://registry.yarnpkg.com/@slack%2fbolt" finished with status code 200.
verbose 0.499742 Performing "GET" request to "https://registry.yarnpkg.com/@slack%2flogger".
verbose 0.500095042 Performing "GET" request to "https://registry.yarnpkg.com/@slack%2foauth".
verbose 0.500514167 Performing "GET" request to "https://registry.yarnpkg.com/@slack%2fsocket-mode".
verbose 0.501111708 Performing "GET" request to "https://registry.yarnpkg.com/@slack%2ftypes".
verbose 0.50189825 Performing "GET" request to "https://registry.yarnpkg.com/@slack%2fweb-api".
verbose 0.586010042 Request "https://registry.yarnpkg.com/@slack%2flogger" finished with status code 200.
verbose 0.621053042 Request "https://registry.yarnpkg.com/@slack%2foauth" finished with status code 200.
verbose 0.632662 Request "https://registry.yarnpkg.com/@slack%2ftypes" finished with status code 200.
verbose 0.635226125 Request "https://registry.yarnpkg.com/@slack%2fsocket-mode" finished with status code 200.
verbose 0.640045208 Request "https://registry.yarnpkg.com/@slack%2fweb-api" finished with status code 200.
[3/5] 🚚  Fetching packages...
info @nrwl/nx-darwin-x64@15.9.4: The CPU architecture "arm64" is incompatible with this module.
info "@nrwl/nx-darwin-x64@15.9.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info @nrwl/nx-linux-arm-gnueabihf@15.9.4: The platform "darwin" is incompatible with this module.
info "@nrwl/nx-linux-arm-gnueabihf@15.9.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info @nrwl/nx-linux-arm-gnueabihf@15.9.4: The CPU architecture "arm64" is incompatible with this module.
info @nrwl/nx-linux-arm64-gnu@15.9.4: The platform "darwin" is incompatible with this module.
info "@nrwl/nx-linux-arm64-gnu@15.9.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info @nrwl/nx-linux-arm64-musl@15.9.4: The platform "darwin" is incompatible with this module.
info "@nrwl/nx-linux-arm64-musl@15.9.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info @nrwl/nx-linux-x64-gnu@15.9.4: The platform "darwin" is incompatible with this module.
info "@nrwl/nx-linux-x64-gnu@15.9.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info @nrwl/nx-linux-x64-gnu@15.9.4: The CPU architecture "arm64" is incompatible with this module.
info @nrwl/nx-linux-x64-musl@15.9.4: The platform "darwin" is incompatible with this module.
info "@nrwl/nx-linux-x64-musl@15.9.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info @nrwl/nx-linux-x64-musl@15.9.4: The CPU architecture "arm64" is incompatible with this module.
info @nrwl/nx-win32-arm64-msvc@15.9.4: The platform "darwin" is incompatible with this module.
info "@nrwl/nx-win32-arm64-msvc@15.9.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info @nrwl/nx-win32-x64-msvc@15.9.4: The platform "darwin" is incompatible with this module.
info "@nrwl/nx-win32-x64-msvc@15.9.4" is an optional dependency and failed compatibility check. Excluding it from installation.
info @nrwl/nx-win32-x64-msvc@15.9.4: The CPU architecture "arm64" is incompatible with this module.
error @slack/logger@4.0.0: The engine "node" is incompatible with this module. Expected version ">= 18". Got "16.20.2"
verbose 0.915547417 Error: Found incompatible module.
    at MessageError.ExtendableBuiltin (/opt/homebrew/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/opt/homebrew/lib/node_modules/yarn/lib/cli.js:750:123)
    at checkOne (/opt/homebrew/lib/node_modules/yarn/lib/cli.js:48058:11)
    at Object.check (/opt/homebrew/lib/node_modules/yarn/lib/cli.js:48077:5)
    at /opt/homebrew/lib/node_modules/yarn/lib/cli.js:7348:73
    at Generator.next (<anonymous>)
    at step (/opt/homebrew/lib/node_modules/yarn/lib/cli.js:310:30)
    at /opt/homebrew/lib/node_modules/yarn/lib/cli.js:321:13
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Please either add the information about dropping Node 16 to the CHANGELOG.md or revert (if you intend for Node 16 to work, not sure if it's a priority for Contentstack)

or maybe add an engines >= field as well

sethidden commented 6 months ago

Ah it's just yarn's error - it installs on npm but shows warnings about incompatible engine, where it errors on yarn instead.

See also https://github.com/slackapi/bolt-js/issues/2085

Still, for example our package uses contentstack@^3.17.1, so it'll resolve to contentstack@3.19.x if someone else installs it, and it won't work on Node 16 if someone uses yarn

EDIT: https://github.com/slackapi/bolt-js/issues/2085#issuecomment-2033871950 Seems that it's @slack/bolt@3.14.0, not 3.17.1, so reverting to 3.14 would fix it, if you need Node 16 support

sethidden commented 6 months ago

https://github.com/contentstack/contentstack-javascript/blob/1f05b9a25d28db225485d2fda4c5b0cbd999f8f6/sanity-report.js#L2

Given that bolt is only used in an internal script and not the package runtime, it should be in devDepencies, not dependencies, no? πŸ˜…

bartoszherba commented 5 months ago

Hello guys, any progress on this one?

nadeem-cs commented 5 months ago

Hey @sethidden @bartoszherba , we will be releasing a new version with the fix very soon. I will update here once its released.

harshithad0703 commented 5 months ago

@sethidden The fix has been released, please do check.