Upon deploy with SST v0.66.3 `(node:26760) [DEP012...
# help
a
Upon deploy with SST v0.66.3
(node:26760) [DEP0128] DeprecationWarning: Invalid 'main' field in '/Users/adamfanello/dev/onica/casa/node_modules/@serverless-stack/resources/dist/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
If this was fixed in later release... then I can paste up all the errors I get when progressing beyond this version. 😞
f
Hey @thdxr, any idea about this one?
t
not sure why that's invalid
Adam in node modules does dist/index.js exist?
a
Yes
f
I don’t have
node_modules/@serverless-stack/resources/dist/package.json
, is this a Node 16 specific? 🤔
@Adam Fanello when do u get this error?
a
🤷 Could me. I thought it was really weird that you seemed to be including node_modules in your packages. The timing of me first noticing this stuff does fit with my upgrading to NPM v8 and using NPM workspaces.
When I sst build or deploy, it shows up right after the last line of
Building function
.
f
Does SST work properly after this warning? Or did u have to downgrade NPM?
a
Thank you. Strangely, everything works. Can't downgrade as that would break the whole monorepo. No such warning in previous versions.
(I think I jumped from 0.63.0. Can check if that'd help.)
f
yeah that’d be helpful if u get a chance
a
Confirmed - 0.63.0.
f
u mean no warning in 0.63.0?
a
Correct
t
oh just noticed it was dist/package.json - that's weird
a
Yup. Oh, so it's probably looking for dist/dist/index.js
f
I think 0.66.3 is weird.. I see
dist/package.json
Lemme check one of the newer releases
a
I'm ready to try a newer release again now to and report that. I had some blocking mess when I tried anything past 0.66.3, but don't recall what exactly.
f
Yeah just checked the latest version 0.69.0. It doesn’t have
dist/package.json
Maybe give
0.69.0
a try?
a
Oh, I think the issue I had with newer is incompatible cdk library between sst and cdk-iam-floyd. I already have to do this in the workspace package.json:
Copy code
"overrides": {
    "aws-cdk-lib": "2.7.0"
  }
f
is
cdk-floyd
using
2.7.0
?
a
No, 0.63.3 is. I may be able to get rid of that - I think both are on 2.15.0 now.
f
yeah
0.69.0
uses 2.15.0
t
cdk-floyd looks cool mabye we should just have that in sst
a
Yeah, I love that thing! Had to jump through a weird loop to make it work with SST, but you can probably fix that from your end. Digging up bug report...
Here's what I get upgrade to 0.69.0:
Copy code
% npm i @serverless-stack/cli@0.69.0 @serverless-stack/resources@0.69.0 -D -w cloud
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: ts-jest@27.1.3
npm WARN Found: esbuild@0.12.29
npm WARN node_modules/esbuild
npm WARN   peer esbuild@"~0.12.28" from @anatine/esbuild-decorators@0.2.18
npm WARN   node_modules/@anatine/esbuild-decorators
npm WARN     dev @anatine/esbuild-decorators@"^0.2.18" from @pkg/cloud@1.2.0
npm WARN     cloud
npm WARN   4 more (@serverless-stack/cli, @serverless-stack/resources, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peerOptional esbuild@"~0.14.0" from ts-jest@27.1.3
npm WARN cloud/node_modules/@serverless-stack/cli/node_modules/ts-jest
npm WARN   ts-jest@"^27.1.3" from @serverless-stack/cli@0.69.0
npm WARN   cloud/node_modules/@serverless-stack/cli
npm WARN 
npm WARN Conflicting peer dependency: esbuild@0.14.27
npm WARN node_modules/esbuild
npm WARN   peerOptional esbuild@"~0.14.0" from ts-jest@27.1.3
npm WARN   cloud/node_modules/@serverless-stack/cli/node_modules/ts-jest
npm WARN     ts-jest@"^27.1.3" from @serverless-stack/cli@0.69.0
npm WARN     cloud/node_modules/@serverless-stack/cli
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @typescript-eslint/parser@4.33.0
npm WARN Found: eslint@8.10.0
npm WARN node_modules/eslint
npm WARN   peer eslint@"^7.5.0 || ^8.0.0" from @babel/eslint-parser@7.17.0
npm WARN   node_modules/@babel/eslint-parser
npm WARN     peer @babel/eslint-parser@">=7.11.0" from @babel/eslint-plugin@7.16.5
npm WARN     node_modules/@babel/eslint-plugin
npm WARN     2 more (@serverless-stack/cli, eslint-config-serverless-stack)
npm WARN   23 more (@babel/eslint-plugin, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from @typescript-eslint/parser@4.33.0
npm WARN cloud/node_modules/eslint-config-serverless-stack/node_modules/@typescript-eslint/parser
npm WARN   @typescript-eslint/parser@"^4.15.1" from eslint-config-serverless-stack@0.69.0
npm WARN   cloud/node_modules/eslint-config-serverless-stack
npm WARN 
npm WARN Conflicting peer dependency: eslint@7.32.0
npm WARN node_modules/eslint
npm WARN   peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from @typescript-eslint/parser@4.33.0
npm WARN   cloud/node_modules/eslint-config-serverless-stack/node_modules/@typescript-eslint/parser
npm WARN     @typescript-eslint/parser@"^4.15.1" from eslint-config-serverless-stack@0.69.0
npm WARN     cloud/node_modules/eslint-config-serverless-stack
npm WARN deprecated read-package-tree@5.3.1: The functionality that this package provided is now in @npmcli/arborist
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See <https://v8.dev/blog/math-random> for details.

added 715 packages, removed 7 packages, and audited 3317 packages in 36s

184 packages are looking for funding
  run `npm fund` for details

5 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
(I have jest v26 still. I can upgrade that, but eslint has its own issues.)
f
@thdxr might be more familiar with this
t
everything works though right?
a
Oh, I don't even try. That looks pretty fatal. I haven't figured out how to make sense of these messages. (Trying to build..)
t
we really gotta strip ts-jest and eslint from our bundled deps, causes all these situations
a
Oh, it's eslint, not esbuild.
Here's my eslint:
Copy code
"eslint": "^8.10.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-jest": "^26.1.1",
    "eslint-plugin-jsdoc": "^37.9.7",
    "eslint-plugin-prefer-arrow": "^1.2.3",
Oh, there's esbuild complaints too.
I'll remove my jest and rely on yours. Your eslint versions are old though. Just haven't updated, or reason to stay a version back?
All appears to be working despite the onslaught of warnings. I can't deliver with all that though.
f
we really gotta strip ts-jest and eslint from our bundled deps, causes all these situations
Agreed. We should include this in v1 @thdxr
@Adam Fanello we should have some of the dependencies stuff cleared up over the next week or two for v1.0 version bump.
a
Oooh v1.0!
f
In the meanwhile, are the warnings gone after u relying on SST’s jest and eslint?
a
I removed my reference to jest 26 and all the non-eslint warnings went away. Strangely though, it's still running jest 26.
I'd have to do major version downgrade of eslint? What versions and plugins are you including?
f
actually i will let @thdxr reply to this as he’s more familiar.
a
Gets messy too because I have other packages in the monorepo that don't use SST. I try to keep typescript/eslint/jest in sync between them. Maybe I live with the warnings for a week or two.
t
You should be able to use your own version of eslint and ignore the warnings right?
a
By ignore I mean watch the terminal bleed, weep, and move on.... yes. 😄
If it's just a couple weeks though, I'll manage.
t
we're shooting for beginning of April, appreciate the patience
f