Coder Social home page Coder Social logo

Comments (6)

jayair avatar jayair commented on June 18, 2024

Make sure your CDK versions match what sst version prints?

from sst.

splicebison avatar splicebison commented on June 18, 2024

@jayair @louismorgan-linaro

This is due to aws-cdk-lib being installed twice with two different versions. Scoped @aws-cdk/* libs have a dependency on ^2.110.1 whereas the latest version installed is 2.114.0. This is what is causing the conflict.

You can temporarily work around this by setting your resolutions in your package.json file as such:

"resolutions": {
  "aws-cdk-lib": "2.110.1"
},

After, install again and the TS conflicts will go away.

from sst.

louismorgan-linaro avatar louismorgan-linaro commented on June 18, 2024

I managed to fix it yesterday by just uninstalling aws-cdk-lib, constructs and sst then reinstalling sst only. It all seems to work but I think when I initiated the repo with create-sst it had aws-cdk-lib explicitly in the package.json file.

Is there any reason why I shouldn't proceed with only sst as an explicit dependency?

from sst.

splicebison avatar splicebison commented on June 18, 2024

Is there any reason why I shouldn't proceed with only sst as an explicit dependency?

Yes, a few. It's unreliable to others on your team as you're not explicitly setting project dependencies (even if you are solo, please make this a good habit). You are also relying on peer dependencies for app/development functionality. If those peers change one day, it will break your apps.

By using the resolutions prop, it allows you to continue to (correctly) ever-green your project dependencies until peers / other libs catch-up or fix their dependency tree. The resolution can be removed at a later date when it's fixed by the package maintainers. Also, this way, you are then explicitly declaring a dev dependency for dev work that is required within your project.

from sst.

splicebison avatar splicebison commented on June 18, 2024

@jayair While we're on the topic, sst current has a hard dependency on aws-cdk-lib. It probably makes more sense to have this as a peer dependency or remove it from the docs and create-set (same goes for constructs).

@louismorgan-linaro my previous comment to you was based on the assumption that aws-cdk-lib and constructs were peer dependencies since they are added to the project when using create sst. I looked at the package.json after and realized they are not peers. In that case, relying on only SST is fine however that's up for the maintainers to decide for how to address this moving forward.

from sst.

louismorgan-linaro avatar louismorgan-linaro commented on June 18, 2024

Thanks very much for all the info @splicebison !

from sst.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.