Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Export 'project-name-ServerlessAliasReference' does not exist. #186

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ rules:
linebreak-style:
- error
- unix
no-trailing-spaces: error
semi:
- error
- always
Expand Down
6 changes: 3 additions & 3 deletions lib/deferredOutputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ module.exports = {

/**
* Register a deferred output
* @param {string} sourceOutput
* @param {Object} targetObject
* @param {string} targetPropertyName
* @param {string} sourceOutput
* @param {Object} targetObject
* @param {string} targetPropertyName
*/
addDeferredOutput(sourceOutput, targetObject, targetPropertyName) {
this.options.verbose && this.serverless.cli.log(`Register deferred output ${sourceOutput} -> ${targetPropertyName}`);
Expand Down
2 changes: 1 addition & 1 deletion lib/removeAlias.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ module.exports = {
this._serverless.cli.log('noDeploy option active - will do nothing');
return BbPromise.resolve();
}

this._masterAlias = currentTemplate.Outputs.MasterAliasName.Value;
if (this._stage && this._masterAlias === this._alias) {
// Removal of the master alias is requested -> check if any other aliases are still deployed.
Expand Down
6 changes: 4 additions & 2 deletions lib/stackInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ module.exports = {
.mapSeries(stack => BbPromise.join(BbPromise.resolve(stack), this.aliasStackLoadTemplate(stack)))
.map(stackInfo => ({ stack: stackInfo[0], template: stackInfo[1] }))
.catch(err => {
if (err.statusCode === 400) {
if (err.statusCode === 400

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about (to make it easier to understand):

Suggested change
if (err.statusCode === 400
if (
err.statusCode === 400 ||
(
err.statusCode === undefined &&
err.providerError &&
err.providerError.statusCode === 400
)
) {

|| (err.statusCode === undefined && err.providerError && err.providerError.statusCode === 400)
) {
// The export is not yet there. Can happen on the very first alias stack deployment.
return BbPromise.resolve([]);
}
Expand Down Expand Up @@ -176,7 +178,7 @@ module.exports = {

const currentAliasStackTemplate = _.get(_.first(removed), 'template', {});
const deployedAliasStackTemplates = _.map(filteredAliasStackTemplates, template => template.template);

this._serverless.service.provider.deployedCloudFormationTemplate = currentTemplate;
this._serverless.service.provider.deployedCloudFormationAliasTemplate = currentAliasStackTemplate;
this._serverless.service.provider.deployedAliasTemplates = filteredAliasStackTemplates;
Expand Down
Loading