Giter Site home page Giter Site logo

Comments (13)

rubenkaiser avatar rubenkaiser commented on August 22, 2024 2

[email protected] was just released as the stable version.

from serverless-offline-eventbridge.

kevbaldwyn avatar kevbaldwyn commented on August 22, 2024 1

We're getting the same issue on AWS codebuild with a standard serverless deploy --stage=blah when using version 1.6.0. The deploy happens but the process never exits and the build times out. Downgrading to 1.5.2 fixes the issue.

from serverless-offline-eventbridge.

rubenkaiser avatar rubenkaiser commented on August 22, 2024 1

I've released a beta version that should resolve the issue. The problem was with the imports of 'aedes' and 'net' packages, which initialized immediately. This has been moved to the init function of the plugin.

Try the following version: [email protected]

Let me know if this works for you guys.

from serverless-offline-eventbridge.

davidjung1977 avatar davidjung1977 commented on August 22, 2024 1

We had the same issue on circleCi and GithubActions. Last lines of Deployment (Verbose Mode):

Serverless: Stack Output saved to file: .serverless/stack-output/outputs.json
Serverless: Stack Output saved to file: .serverless/stack-output/outputs.yml
Serverless: Removing old service artifacts from S3...

Using the [email protected] solves the problem.

Unfortunately the dependabot marks the 1.6.0. as stable.

from serverless-offline-eventbridge.

rubenkaiser avatar rubenkaiser commented on August 22, 2024 1

I'll release a new version (1.6.1) as soon as the others also confirm it works

from serverless-offline-eventbridge.

rcoundon avatar rcoundon commented on August 22, 2024 1

Hi - just to confirm, it worked for us too

from serverless-offline-eventbridge.

rubenkaiser avatar rubenkaiser commented on August 22, 2024

Can you try deploying using the --verbose option? Maybe this will give us a better indication of what is going wrong.

from serverless-offline-eventbridge.

damien-thiesson avatar damien-thiesson commented on August 22, 2024

Do you have any specific script configured in your package.json? Also, do you confirm all your serverless packages are listed as devDependencies, and you exclude devDependencies from the artifact build?

from serverless-offline-eventbridge.

cristian-pelegrin avatar cristian-pelegrin commented on August 22, 2024

hi @rcoundon !. any updates with this issue?, did you solve it?, I'm running into the same issue with the same version.
after run the serverless package command the script hang on that part
image

from serverless-offline-eventbridge.

rcoundon avatar rcoundon commented on August 22, 2024

Hi - sorry for radio silence, this is happening on the packaging stage and the CI tool we're using (Seed.run) doesn't yet have the option for verbose output for that command but hopefully it's coming soon.

@damien-thiesson In regard to specific scripts, no, it's just a standard sls deploy --stage someStage
We don't set excludeDevDependencies in serverless.ts and the default is true so my assumption is that the devDependencies are excluded

from serverless-offline-eventbridge.

rubenkaiser avatar rubenkaiser commented on August 22, 2024

Just created a test project and at my end it deploys just fine. Can you try to deploy my simple example?

package.json

{
	"name": "serverless-offline-eventbridge-deployment-test",
	"version": "1.0.0",
	"description": "",
	"main": "index.js",
	"scripts": {
		"start": "SLS_DEBUG=* sls offline start --log-level info"
	},
	"author": "",
	"license": "ISC",
	"devDependencies": {
		"serverless-offline": "^7.0.0",
		"serverless-offline-aws-eventbridge": "^1.6.0",
		"serverless-webpack": "^5.5.1",
		"webpack": "^5.39.1",
		"webpack-node-externals": "^3.0.0"
	},
	"dependencies": {
		"@babel/core": "^7.8.7",
		"@babel/plugin-transform-runtime": "^7.8.3",
		"@babel/preset-env": "^7.8.7",
		"@babel/runtime": "^7.8.7",
		"aws-sdk": "^2.633.0",
		"babel-loader": "^8.0.6",
		"serverless": "2.47.0"
	}
}

serverless.yml

service: deploymentTestEventBridge

plugins:
  - serverless-webpack
  - serverless-offline-aws-eventbridge
  - serverless-offline

custom:
  webpack:
    webpackConfig: ./webpack.config.js
    #includeModules: true
  serverless-offline:
    host: 0.0.0.0
  serverless-offline-aws-eventbridge:
    port: 4010
    debug: true

provider:
  name: aws
  runtime: nodejs12.x
  stage: dev
  region: eu-west-1

functions:
  publishEvent:
    handler: events.publish
    events:
      - http:
          path: publish
          method: get

  consumeEvent:
    handler: events.consume
    events:
      - eventBridge:
          eventBus: marketingDeploymentTestEventBridge
          pattern:
            source:
              - graph
            detail-type:
              - update
            detail:
              trigger:
                name:
                  - company
                event:
                  data:
                    new:
                      status:
                        - archived
                        - open

events.js

import AWS from 'aws-sdk';

AWS.config.update({
  apiVersion: '2015-10-07',
  accessKeyId: "YOURKEY",
  secretAccessKey: "YOURSECRET",
  region: "eu-west-1"
});

export const publish = async () => {
  try {
    const eventBridge = new AWS.EventBridge({
      endpoint: 'http://127.0.0.1:4010',
      region: 'eu-west-1'
    });
    const test = await eventBridge.putEvents({
      Entries: [
        {
          EventBusName: 'marketingDeploymentTestEventBridge',
          Source: 'graph',
          DetailType: 'update',
          Detail: JSON.stringify({
            trigger: {
              name: "company",
              event: {
                data: {
                  // test: 'bla',
                  new: {
                    status: 'archived'
                  }
                }
              }

            }

          })
        },
      ]
    }).promise();

  } catch (e) {
    console.error(e);
    return { statusCode: 400, body: 'could not publish' };
  }
  return { statusCode: 200, body: 'published' };
}

export const consume = async (event, context) => {
  console.log("CONSUME 2");
  console.log(event);
  return { statusCode: 200, body: 'consume2' };
}

webpack.config.js

const slsw = require("serverless-webpack");
const nodeExternals = require("webpack-node-externals");

module.exports = {
  entry: slsw.lib.entries,
  target: "node",
  // Since 'aws-sdk' is not compatible with webpack,
  // we exclude all node dependencies
  externals: [nodeExternals()],
  mode: slsw.lib.webpack.isLocal ? "development" : "production",
  optimization: {
    // We no not want to minimize our code.
    minimize: false
  },
  performance: {
    // Turn off size warnings for entry points
    hints: false
  },
  // Run babel on all .js files and skip those in node_modules
  module: {
    rules: [
      {
        test: /\.js$/,
        loader: "babel-loader",
        include: __dirname,
        exclude: /node_modules/
      }
    ]
  }
};

from serverless-offline-eventbridge.

rcoundon avatar rcoundon commented on August 22, 2024

I've released a beta version that should resolve the issue. The problem was with the imports of 'aedes' and 'net' packages, which initialized immediately. This has been moved to the init function of the plugin.

Try the following version: [email protected]

Let me know if this works for you guys.

Thanks - I'll give this a go and report back

from serverless-offline-eventbridge.

rcoundon avatar rcoundon commented on August 22, 2024

[email protected] was just released as the stable version.

Brilliant - thank you

from serverless-offline-eventbridge.

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.