dawson-org / dawson-cli

A serverless web framework for Node.js on AWS (CloudFormation, CloudFront, API Gateway, Lambda)
https://dawson.sh
GNU General Public License v3.0
713 stars 25 forks source link

Error: A sibling of this resource already has a variable path part -- only one is allowed #175

Closed azappa closed 7 years ago

azappa commented 7 years ago

ref: https://github.com/dawson-org/dawson-cli/issues/166

I write a lambda file with two get routes (they share the same code, i mede a second one to show an alternative preview)

export async function service (event) {
  const _lang = event.params.path.lang;
  const _uid = event.params.path.serviceUid;

  console.log(`service page called with uid ${_uid} and lang ${_lang}.`);

  <… my code>
}
service.api = {
  path: '{lang}/service/{serviceUid}'
};

export async function serviceAlt (event) {
  const _lang = event.params.path.lang;
  const _uid = event.params.path.uidForService;

  console.log(`service page called with uid ${_uid} and lang ${_lang}.`);

  <… my code>
}
serviceAlt.api = {
  path: '{lang}/serviceAlt/{uidForService}'
};

The error I get:

   ┌──────────────┬───────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────┬───────────────────────┐
   │ Timestamp    │ Status        │ Reason                                                                                            │ Logical Id            │
   ├──────────────┼───────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────────┤
   │ un minuto fa │ UPDATE_FAILED │ Resource update cancelled                                                                         │ LambdaEvents          │
   ├──────────────┼───────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────────┤
   │ un minuto fa │ CREATE_FAILED │ A sibling ({serviceUid}) of this resource already has a variable path part -- only one is allowed │ ResourceUidForService │
   └──────────────┴───────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────────┘
stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

lusentis commented 7 years ago

Can't reproduce this issue with the latest release (v0.28), I'm closing for now, feel free to re-open with further details and a link to a project/report/gist that shows this error.