working on updating my <sst-prisma template repo> ...
# general
m
working on updating my sst-prisma template repo to the latest prisma/sst/node16, adding appsync and graphql schema generator examples, eslint+prettier: https://github.com/jetbridge/sst-prisma/pulls i'm just blocked on this one error https://github.com/serverless-stack/serverless-stack/issues/1735
t
I fixed this issue yesterday
make sure you don't have a dep on ws directly and you wipe your node_modules
m
oh ok thx
feel free to review those PRs if you like šŸ™‚
i want to make this the best starter kit (and use it myself)
t
curious what the layer size ends up being
and what you're seeing with cold starts
m
they are working on the cold start thing right now, it will get better
t
how so?
m
for one thing loading the DMMF at runtime i believe
i made some suggestions like encoding falsy values as not present, which they may or may not be doing
t
that helps but it still needs the big rust binaries right
m
i mean yeah but so what
i got the layer down to 15MB zipped
44MB unzipped
with a lot of effort
the layer with migration sdk and engine is 25MB zipped
t
that's pretty good!
m
i think they can be overlaid but i didn't have a lot of success yet with that
t
yeah the migration cold start is less of a big deal
t
I commented on the size because I've seen it impact the cold start a lot
so curious what it looks like now
m
they do respond to feedback
be sure to raise your concerns with them
still seeing this
Copy code
FAIL  stacks/main.test.ts
  ā— Test suite failed to run

    SyntaxError: The requested module 'ws' does not provide an export named 'WebSocketServer'

      at Runtime.linkAndEvaluateModule (node_modules/jest-runtime/build/index.js:779:5)
      at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
      at runJest (node_modules/@jest/core/build/runJest.js:404:19)
      at _run10000 (node_modules/@jest/core/build/cli/index.js:320:7)
      at runCLI (node_modules/@jest/core/build/cli/index.js:173:3)

Test Suites: 1 failed, 2 passed, 3 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        4.99 s
Ran all test suites.
āžœ  sst-prisma git:(lint-prettier) npm ls @serverless-stack/resources
myapp@0.1.0 /Users/cyber/dev/sst-prisma
ā”œā”€ā”¬ @serverless-stack/cli@1.2.5
│ └── @serverless-stack/resources@1.2.5 deduped
└── @serverless-stack/resources@1.2.5
i rm'd node_modules (let me try once more to be sure)
t
hm what is this test doing?
shouldn't really try to load ws anywhere afaik
m
test is linked there
Copy code
āžœ  sst-prisma git:(lint-prettier) npm ls ws
myapp@0.1.0 /Users/cyber/dev/sst-prisma
ā”œā”€ā”¬ @graphql-codegen/cli@2.6.2
│ └─┬ @graphql-tools/url-loader@7.9.23
│   ā”œā”€ā”¬ isomorphic-ws@4.0.1
│   │ └── ws@8.6.0 deduped
│   └── ws@8.6.0 deduped
ā”œā”€ā”¬ @serverless-stack/cli@1.2.5
│ ā”œā”€ā”¬ @serverless-stack/core@1.2.5
│ │ └── ws@8.6.0 deduped
│ └── ws@8.6.0
ā”œā”€ā”¬ @sls-next/lambda-at-edge@3.7.0
│ └─┬ @aws-sdk/client-s3@3.54.0
│   └─┬ @aws-sdk/middleware-sdk-s3@3.54.0
│     └─┬ @aws-sdk/signature-v4-crt@3.88.0
│       └─┬ aws-crt@1.12.2
│         ā”œā”€ā”¬ @httptoolkit/websocket-stream@6.0.0
│         │ └── ws@8.6.0 deduped
│         ā”œā”€ā”¬ mqtt@4.3.7
│         │ └── ws@7.5.7
│         └── ws@7.5.7
└─┬ jest@27.5.1
  └─┬ @jest/core@27.5.1
    └─┬ jest-config@27.5.1
      └─┬ jest-environment-jsdom@27.5.1
        └─┬ jsdom@16.7.0
          └── ws@7.5.7