profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/mimetnet/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Matthew Metnetsky mimetnet Konica Minolta Business Solutions U.S.A., Inc Canton, CT https://twitter.com/mimetnet

mimetnet/node-stream-array 38

Pipe an Array through Node.js streams

mimetnet/node-stream-generators 5

Pipe ES6 Generators through Node.js streams

mimetnet/node-stringify-stream 5

Streaming Transform of objects via JSON.stringify

MopriaAlliance/CUPS-for-Android 5

CUPS-for-Android

mimetnet/node-ei 2

Erlang Interface for Node.js

mimetnet/mongodb-writable-stream 1

Pipe a stream into a MongoDB collection and out again if needed!

mimetnet/chocolatey-packages 0

Packages released to chocolatey.

mimetnet/couch-time 0

Track time across computers so you don't have to do it later on the couch

mimetnet/goreleaser 0

Deliver Go binaries as fast and easily as possible

push eventwingtk/gvsbuild

Ignacio Casal Quinteiro

commit sha 95813e08345ec9f8234122dd6c87a7608d0e087e

libxml2: update to 2.9.12

view details

Ignacio Casal Quinteiro

commit sha 084337ae827cdfd4b806ee3fba68860f735e89f8

Export the tarballs when building And allow to choose the directory to export the tarballs by default it is build-dir\export Fixes #326

view details

guruDanny67

commit sha 193ba64c6d70ea56d9f84a83d31839ba9de60b27

Create the export dir at the beginning, even if the original tarball are already downloaded

view details

guruDanny67

commit sha b5bf22447bcdea137351f6cc011077939ce77075

Groups doesn't need to be exported

view details

push time in 2 days

push eventwingtk/gvsbuild

Ignacio Casal Quinteiro

commit sha 95813e08345ec9f8234122dd6c87a7608d0e087e

libxml2: update to 2.9.12

view details

push time in 2 days

issue openedwingtk/gvsbuild

Error: libepoxy build failed (Build by VS2019)

Environment: OS version: Windows 10 20H2 Visual Studio version: 2019 MSYS2 64bit version: 20201109 Build command: python .\build.py build -p x64 --vs-ver 16 gtk3 --msys-dir='E:\Program_Files\msys64' --vs-install-path='D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise'

ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\builder.py", line 492, in build
    if self.__build_one(p):
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\builder.py", line 618, in __build_one
    skip_deps = proj.build()
  File "C:\gtk-build\github\gvsbuild\gvsbuild\projects.py", line 1093, in build
    Meson.build(self)
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\base_builders.py", line 76, in build
    self.builder.exec_ninja(params='install', working_dir=ninja_build)
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\builder.py", line 902, in exec_ninja
    self.__execute(self.__sub_vars(cmd), working_dir=working_dir, add_path=add_path, env=self.vs_env)
  File "C:\gtk-build\github\gvsbuild\gvsbuild\utils\builder.py", line 942, in __execute
    subprocess.check_call(args, cwd=working_dir, env=env, shell=True)
  File "E:\Program_Files\Python39\lib\subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'ninja install' returned non-zero exit status 1.
Error: libepoxy build failed

Detailed log is attached. gvsbuild-log.txt

created time in 3 days

pull request commentwingtk/gvsbuild

force UTF-8 encoding when patching fontconfig vc project file

By testing, this PR does fix #411.

boondaburrah

comment created time in 3 days

issue commentmicrosoft/Power-Fx

Project architecture

Can you provide any information about the PowerFX language implementation? While this is interesting to me, I have no idea if the implementation can be embedded in C++ applications, requires dotNet, or is web/JS based. Additionally, does it run interpreted or does it have a bytecode, is that bytecode standardized? What are the potentials for platform support.

You are free to implement PowerFX support in whatever language (or using whatever tools) you would like, but you would need to create your own interpreter or complier.

This project simply defines PowerFX, much like a book defining HTML doesn’t require the existence of a web browser, let alone an implementation of one. Those familiar with IETF Internet RFCs might think of this as [draft-language-powerfx], the draft of a specification RFC.

(Put another way: one wouldn’t expect a book on Latin to come with the DNA for an ancient Roman citizen, nor should such a Roman be required to make some productive use of Latin.)

PowerFX is primarily a functional language (think Haskell), not a procedural one. It’s also very high-level. I don’t believe functional languages can be reduced directly to bytecode, since assembly / machine code on traditional processors is fundamentally procedural. If that is correct, then it will need an interpreter, just like PostScript or Python.

Tl;dr: the Microsoft code implementing PowerFX in their Power Platform is still proprietary and not available to the public.

se16n

comment created time in 3 days

pull request commentmicrosoft/Power-Fx

Ignore - branch deleted after requesting pull

I renamed my branch after submitting this pull request, causing it to auto-close. Resubmitted under the correct branch name.

jgrisham

comment created time in 3 days

PR opened microsoft/Power-Fx

Correct grammar production for ‘IdentiferName’

The grammar production for ‘IdentifierName‘, specifically the second alternative ‘SingleQuotedIdentifier’, is missing the opening and closing ‘single quote’ (U+0027) tokens.

This is a correction to make that consistent with the syntax shown in the grammar production for ‘TextLiteral’.

(There may be further changes required in other files identified by a SME at a later date.)

+2 -2

0 comment

2 changed files

pr created time in 3 days

PR closed microsoft/Power-Fx

Correct grammar production for ‘IdentiferName’

The grammar production for ‘IdentifierName‘, specifically the second alternative ‘SingleQuotedIdentifier’, is missing the opening and closing ‘single quote’ (U+0027) tokens.

This is a correction to make that consistent with the syntax shown in the grammar production for ‘TextLiteral’.

(There may be further changes required in other files identified by a SME at a later date.)

+2 -2

1 comment

2 changed files

jgrisham

pr closed time in 3 days

pull request commentmicrosoft/Power-Fx

Correct grammar production for ‘IdentiferName’

CLA assistant check <br/>Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.<br/><br/>:x: jgrisham sign now<br/><sub>You have signed the CLA already but the status is still pending? Let us recheck it.</sub>

jgrisham

comment created time in 3 days

PR opened microsoft/Power-Fx

Correct grammar production for ‘IdentiferName’

The grammar production for ‘IdentifierName‘, specifically the second alternative ‘SingleQuotedIdentifier’, is missing the opening and closing ‘single quote’ (U+0027) tokens.

This is a correction to make that consistent with the syntax shown in the grammar production for ‘TextLiteral’.

(There may be further changes required in other files identified by a SME at a later date.)

+2 -2

0 comment

2 changed files

pr created time in 3 days

issue closedlocalstack/serverless-localstack

HelloWorld takes 3s on Mac

time sls invoke --function hello --stage local --profile local
Serverless: Using serverless-localstack
{
    "body": "{\n  \"message\": \"Go Serverless v1.0! Your function executed successfully!\",\n  \"input\": {}\n}",
    "statusCode": 200
}

real	0m3.087s
user	0m2.359s
sys	0m0.608s

Can we do better or is it a limitation with docker on Mac. I've read the documentation countless times but it's still totally unclear to me what mountCode does.

I've seen this:

If you are experiencing slow performance with Lambdas in Mac OS, you could either (1) try mounting local code directly into the Lambda container, or (2) disable mounting the temporary directory into the LocalStack container in docker-compose. (See also https://github.com/localstack/localstack/issues/2515)

I've tried (2), here's my docker-compose file:

version: '2.1'
services:
  localstack:
    image: localstack/localstack
    ports:
      - "4566:4566"
      - "4571:4571"
    environment:
      - DEBUG=1
      - DATA_DIR=/tmp/localstack/data
      - LAMBDA_EXECUTOR=docker-reuse
      - LAMBDA_REMOTE_DOCKER=false
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"

try mounting local code directly into the Lambda container

How would this work?

mountCode: false/true

No matter if I change this parameter, I still get 3s.

docker logs:

REPORT RequestId: 6f3aeac0-8694-1c33-c8ee-671c2051bb56 Init Duration: 6000.00 ms Duration: 7.36 ms Billed Duration: 8 ms Memory Size: 1536 MB Max Memory Used: 41 MB

OK I'm not the only one that spotted this behavior:

https://forum.serverless.com/t/2-second-delay-when-calling-sls-invoke-on-a-lambda/2730 https://github.com/serverless/serverless/issues/5410

time curl http://localhost:4566/restapis/0jmgozf1pw/local/user_request/hello real 0m0.710s

OK that's not as bad as I thought. It's just an extra 2s purely for sls invoke.

That's still slow for a hello world. But I'll survive.

Thanks for any feedback/help. Much appreciated 🍡

closed time in 3 days

ThomasLabstep

issue commentlocalstack/serverless-localstack

Lambda execution does not work with package individually: true

Cannot find module

Show us the full log. It could just be the same error I got. My solution was simply to npm update and use the latest webpack 5. Check what your packaged zip look like.

maturiaditya

comment created time in 3 days

issue commentlocalstack/serverless-localstack

Getting error while deploy serverless stack

Here's what I would try:

  • Remove resources in serverless.yml and create your queue using the command line
  • Use a .env config to inject the arn for your queue in sender/receiver

If cloudformation fails, just work around it. It's supposed to help manage your resources. But if it fails to do so, just manage the resources yourself or in a different way.

Here's my sqs trigger handler:

    sqs: {
      handler: 'handler.sqs',
      events: [{
        sqs: {
          arn: 'arn:aws:sqs:ddblocal:000000000000:myproject-dev',
        }
      }]
    }
pravin-raha

comment created time in 3 days

issue openedlocalstack/serverless-localstack

HelloWorld takes 3s on Mac

time sls invoke --function hello --stage local --profile local
Serverless: Using serverless-localstack
{
    "body": "{\n  \"message\": \"Go Serverless v1.0! Your function executed successfully!\",\n  \"input\": {}\n}",
    "statusCode": 200
}

real	0m3.087s
user	0m2.359s
sys	0m0.608s

Can we do better or is it a limitation with docker on Mac. I've read the documentation countless times but it's still totally unclear to me what mountCode does.

I've seen this:

If you are experiencing slow performance with Lambdas in Mac OS, you could either (1) try mounting local code directly into the Lambda container, or (2) disable mounting the temporary directory into the LocalStack container in docker-compose. (See also https://github.com/localstack/localstack/issues/2515)

I've tried (2), here's my docker-compose file:

version: '2.1'
services:
  localstack:
    image: localstack/localstack
    ports:
      - "4566:4566"
      - "4571:4571"
    environment:
      - DEBUG=1
      - DATA_DIR=/tmp/localstack/data
      - LAMBDA_EXECUTOR=docker-reuse
      - LAMBDA_REMOTE_DOCKER=false
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"

try mounting local code directly into the Lambda container

How would this work?

Thanks for any feedback/help. Much appreciated 🍡

created time in 3 days

starteddrcode/lisperati-1000-diy

started time in 3 days

issue commentdocker-library/php

Proper iconv

@tobiasbambullis : Yeah. Just start from image like php:8.0-fpm-alpine3.12 and utilize the workaround @enumag suggested.

davidsteinsland

comment created time in 4 days

issue commentdocker-library/php

problem build basic image

The src/ folder you're copying needs to be in the same directory as the Dockerfile (which is the default build context). So you could move the Dockerfile back a directory mv Dockerfile ../

You could also try asking over at the Docker Community Forums, Docker Community Slack, or Stack Overflow. Since these repos aren't really a user-help forum

Ramsteven

comment created time in 4 days

issue openeddocker-library/php

problem build basic image

hello, I am trying to build an image with this docker file:

FROM php:8.0.6-apache-buster

COPY src/ /var/www/html/

EXPOSE 80

but I have had this error when running this command:

Step 1/3 : FROM php:8.0.6-apache-buster
 ---> 97f22a92e1d1
Step 2/3 : COPY src/ /var/www/html/
COPY failed: file not found in build context or excluded by .dockerignore: stat src/: file does not exist

this is the content of the src folder: Dockerfile index.php

created time in 5 days

issue closedlocalstack/serverless-localstack

Webpack + Typescript - Runtime.ImportModuleError

I've been trying to setup localstack for 2 weeks without luck to replace serverless-offline and all of its weird plugins to simulate dynamodb streams and sqs triggers.

I'm on Mac OSX.

If you can spot the issue, let me know. I'm hopeless at this stage (pun intended).

serverless.ts

import type { Serverless } from 'serverless/aws';

// Load dotenv
require('dotenv').config({
  path: __dirname + '/.env.' + process.env.NODE_ENV
});

const serverlessConfiguration: Serverless = {
  service: {
    name: 'pathofchild',
  },
  frameworkVersion: '2',
  package: {
    individually: true
  },
  custom: {
    webpack: {
      webpackConfig: './webpack.config.js',
      includeModules: true,
      keepoutputDirectory: true
    },
    localstack: {
      stages: ['local'],
      host: 'http://localhost',
      edgePort: 4566,
      autostart: true,
      debug: true,
      lambda: {
        mountCode: true
      },
      docker: {
        sudo: false
      }
    },
  },
  plugins: [
    'serverless-webpack',
    'serverless-localstack',
  ],
  provider: {
    name: 'aws',
    region: process.env.AWS_REGION,
    runtime: 'nodejs12.x',
    apiGateway: {
      minimumCompressionSize: 1024,
    },
    environment: {
      AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',
    },
  },
  functions: {
    graphql: {
      handler: 'lib/handler.graphql',
      events: [
        {
          http: {
            path: 'graphql',
            method: 'post',
            cors: true,
          }
        }
      ]
    }
  }
}

module.exports = serverlessConfiguration;

tsconfig.js

{
  "compilerOptions": {
    "lib": ["es2017", "dom", "esnext"],
    "removeComments": true,
    "moduleResolution": "node",
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "sourceMap": true,
    "esModuleInterop": true,
    "target": "es2017",
    "outDir": ".webpack"
  },
  "include": ["./**/*.ts"],
  "exclude": [
    "node_modules/**/*",
    ".serverless/**/*",
    ".webpack/**/*"
  ]
}

webpack.config.js

const path = require('path');
const slsw = require('serverless-webpack');
const nodeExternals = require('webpack-node-externals');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

module.exports = {
  context: __dirname,
  mode: 'development', // slsw.lib.webpack.isLocal ? 'development' : 'production',
  entry: slsw.lib.entries,
  devtool: 'cheap-module-eval-source-map', // slsw.lib.webpack.isLocal ? 'cheap-module-eval-source-map' : 'source-map',
  resolve: {
    extensions: ['.mjs', '.json', '.ts'],
    symlinks: false,
    cacheWithContext: false,
  },
  output: {
    libraryTarget: 'commonjs',
    path: path.join(__dirname, '.webpack'),
    filename: '[name].js',
  },
  target: 'node',
  externals: [nodeExternals()],
  module: {
    rules: [
      // all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
      {
        test: /\.(tsx?)$/,
        loader: 'ts-loader',
        exclude: [
          [
            path.resolve(__dirname, 'node_modules'),
            path.resolve(__dirname, '.serverless'),
            path.resolve(__dirname, '.webpack'),
            path.resolve(__dirname, 'data'),
            path.resolve(__dirname, 'e2e'),
            path.resolve(__dirname, 'localstack-data'),
          ],
        ],
        options: {
          transpileOnly: true,
          experimentalWatchApi: true,
        },
      },
    ],
  },
  plugins: [
    new ForkTsCheckerWebpackPlugin({
      eslint: true,
      eslintOptions: {
        cache: true
      }
    })
  ],
  optimization: {
    minimize: false,
  },
};

webpack output

Built at: 10/05/2021 16:26:17
         Asset     Size       Chunks             Chunk Names
lib/handler.js  171 KiB  lib/handler  [emitted]  lib/handler
Entrypoint lib/handler = lib/handler.js
[./lib/handler.ts] 910 bytes {lib/handler} [built]

curl -X POST http://localhost:4566/restapis/4lsj8aqf3g/local/user_request/graphql

{
	"errorType": "InvocationException",
	"errorMessage": "Lambda process returned error status code: 1. Result: {
errorType
:
Runtime.ImportModuleError
,
errorMessage
:
Error: Cannot find module '/var/task/lib/handler'\\nRequire stack:\\n- /var/runtime/UserFunction.js\\n- /var/runtime/index.js
}. Output:\n2021-05-10T15:37:04.379Z\tundefined\tERROR\tUncaught Exception \t{
errorType
:
Runtime.ImportModuleError
,
errorMessage
:
Error: Cannot find module '/var/task/lib/handler'\\nRequire stack:\\n- /var/runtime/UserFunction.js\\n- /var/runtime/index.js
,
stack
:[
Runtime.ImportModuleError: Error: Cannot find module '/var/task/lib/handler'
,
Require stack:
,
- /var/runtime/UserFunction.js
,
- /var/runtime/index.js
,
    at _loadUserApp (/var/runtime/UserFunction.js:100:13)
,
    at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)
,
    at Object.<anonymous> (/var/runtime/index.js:43:30)
,
    at Module._compile (internal/modules/cjs/loader.js:999:30)
,
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
,
    at Module.load (internal/modules/cjs/loader.js:863:32)
,
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
,
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
,
    at internal/main/run_main_module.js:17:47
]}\n\u001b[32mSTART RequestId: 9401b9d2-aea5-1673-00d5-d4fcdd96508c Version: $LATEST\u001b[0m\n\u001b[32mEND RequestId: 9401b9d2-aea5-1673-00d5-d4fcdd96508c\u001b[0m\n\u001b[32mREPORT RequestId: 9401b9d2-aea5-1673-00d5-d4fcdd96508c\tInit Duration: 495.68 ms\tDuration: 2.69 ms\tBilled Duration: 3 ms\tMemory Size: 1536 MB\tMax Memory Used: 39 MB\t\u001b[0m",
	"stackTrace": [
		"  File 
/opt/code/localstack/localstack/services/awslambda/lambda_api.py
, line 602, in run_lambda\n    result = LAMBDA_EXECUTOR.execute(func_arn, func_details, event, context=context,\n",
		"  File 
/opt/code/localstack/localstack/services/awslambda/lambda_executors.py
, line 176, in execute\n    return do_execute()\n",
		"  File 
/opt/code/localstack/localstack/services/awslambda/lambda_executors.py
, line 168, in do_execute\n    return _run(func_arn=func_arn)\n",
		"  File 
/opt/code/localstack/localstack/utils/cloudwatch/cloudwatch_util.py
, line 149, in wrapped\n    raise e\n",
		"  File 
/opt/code/localstack/localstack/utils/cloudwatch/cloudwatch_util.py
, line 145, in wrapped\n    result = func(*args, **kwargs)\n",
		"  File 
/opt/code/localstack/localstack/services/awslambda/lambda_executors.py
, line 159, in _run\n    raise e\n",
		"  File 
/opt/code/localstack/localstack/services/awslambda/lambda_executors.py
, line 147, in _run\n    result = self._execute(func_arn, func_details, event, context, version)\n",
		"  File 
/opt/code/localstack/localstack/services/awslambda/lambda_executors.py
, line 325, in _execute\n    result = self.run_lambda_executor(cmd, stdin, env_vars=environment, func_details=func_details)\n",
		"  File 
/opt/code/localstack/localstack/services/awslambda/lambda_executors.py
, line 231, in run_lambda_executor\n    raise InvocationException('Lambda process returned error status code: %s. Result: %s. Output:\\n%s' %\n"
	]
}

My hunch tells me that it's an issue with how docker mounts the lambda code. I think for some reason it's empty and that's why it's not finding the handler defined in my serverless.ts.

I'm rebuilding from a hello world sample slowly until I reach my setup to see where it's failing.

closed time in 5 days

ThomasLabstep

issue commentlocalstack/serverless-localstack

Webpack + Typescript - Runtime.ImportModuleError

Classic but that was the solution:

-    "fork-ts-checker-webpack-plugin": "^3.0.1",
+    "fork-ts-checker-webpack-plugin": "^6.2.6",
-    "serverless-localstack": "^0.4.30",
+    "serverless-localstack": "^0.4.32",
-    "serverless-webpack": "^5.2.0",
+    "serverless-webpack": "^5.5.0",
-    "ts-loader": "^5.3.3",
+    "ts-loader": "^9.1.2",
-    "webpack": "^4.29.0",
+    "webpack": "^5.37.0",
+    "webpack-node-externals": "^3.0.0"
-    "webpack-node-externals": "^1.7.2"

-_-

ThomasLabstep

comment created time in 5 days

issue commentdocker-library/php

Fileinfo extension is not usable with apache2

image hmm, me and my coworker yield the same error, let's me check if pull a fresh php apache work or not

hongan2419

comment created time in 5 days

issue commentdocker-library/php

Fileinfo extension is not usable with apache2

The example works in a file served by Apache as well

FROM php:7.3-apache
COPY index.php /var/www/html
RUN chown -R www-data .
RUN echo test > /usr/local/something.txt

$ cat index.php 
<?php
$finfo = new finfo(FILEINFO_MIME, "/usr/share/misc/magic"); // return mime type ala mimetype extension

/* get mime-type for a specific file */
$filename = "/usr/local/something.txt";
echo $finfo->file($filename);

?>

$ docker run -d --name php -p 8080:80 php:test
b9d0f8954090fb75b6da220425bca070ec734a1e8934c58f5c4b104950e20fb5

$ curl localhost:8080
text/plain; charset=us-ascii
hongan2419

comment created time in 5 days

issue commentdocker-library/php

Fileinfo extension is not usable with apache2

Using the PHP CLI is ok as I mentioned, but when you tried to access it via apache2 it will throw error

hongan2419

comment created time in 5 days

issue commentdocker-library/php

Fileinfo extension is not usable with apache2

I didn't encounter any issue with the examples here https://www.php.net/manual/en/function.finfo-open.php

$ docker run -it --rm php:7.3-apache bash
root@cd2735b30461:/var/www/html# echo test > /usr/local/something.txt
root@cd2735b30461:/var/www/html# php -a
Interactive shell

php > $finfo = new finfo(FILEINFO_MIME, "/usr/share/misc/magic"); // return mime type ala mimetype extens
ion

php > 
php > /* get mime-type for a specific file */
php > $filename = "/usr/local/something.txt";
php > echo $finfo->file($filename);
text/plain; charset=us-ascii
hongan2419

comment created time in 5 days

issue openeddocker-library/php

Fileinfo extension is not usable with apache2

The fileinfo extension is enable by default in php. I can use it inside the docker with CLI shell. But it throw fatal error

Fatal error: Uncaught Error: Call to undefined function finfo_open() in /var/www/html/index.php:2 Stack trace: #0 {main} thrown in /var/www/html/index.php on line 2

when I try to access index.php. My dockerfile:

FROM php:7.3-apache
COPY index.php /var/www/html
RUN chown -R www-data .

index.php

<?php
    $finfo = finfo_open();
?>

created time in 6 days

issue commentlocalstack/serverless-localstack

Endpoint url is not shown when using localstack 0.12.5 or 0.12.6

@whummer

Thanks for your improvement, and I tried to apply the new version! On my environment, that version worked correctly with API Gateway + Lambda + SQS. So, I think this issue can be closed.

svenallers

comment created time in 7 days

pull request commentmicrosoft/Power-Fx

Uniformity of writing style

Looks good. Would be useful to see the =0 case in the animation.

github129

comment created time in 7 days

issue openedlocalstack/serverless-localstack

Webpack + Typescript - Runtime.ImportModuleError

I've been trying to setup localstack for 2 weeks without luck to replace serverless-offline and all of its weird plugins to simulate dynamodb streams and sqs triggers.

I'm on Mac OSX.

If you can spot the issue, let me know. I'm hopeless at this stage.

serverless.ts

import type { Serverless } from 'serverless/aws';

// Load dotenv
require('dotenv').config({
  path: __dirname + '/.env.' + process.env.NODE_ENV
});

const serverlessConfiguration: Serverless = {
  service: {
    name: 'pathofchild',
  },
  frameworkVersion: '2',
  package: {
    individually: true
  },
  custom: {
    webpack: {
      webpackConfig: './webpack.config.js',
      includeModules: true,
      keepoutputDirectory: true
    },
    localstack: {
      stages: ['local'],
      host: 'http://localhost',
      edgePort: 4566,
      autostart: true,
      debug: true,
      lambda: {
        mountCode: true
      },
      docker: {
        sudo: false
      }
    },
  },
  plugins: [
    'serverless-webpack',
    'serverless-localstack',
  ],
  provider: {
    name: 'aws',
    region: process.env.AWS_REGION,
    runtime: 'nodejs12.x',
    apiGateway: {
      minimumCompressionSize: 1024,
    },
    environment: {
      AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',
    },
  },
  functions: {
    graphql: {
      handler: 'lib/handler.graphql',
      events: [
        {
          http: {
            path: 'graphql',
            method: 'post',
            cors: true,
          }
        }
      ]
    }
  }
}

module.exports = serverlessConfiguration;

tsconfig.js

{
  "compilerOptions": {
    "lib": ["es2017", "dom", "esnext"],
    "removeComments": true,
    "moduleResolution": "node",
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "sourceMap": true,
    "esModuleInterop": true,
    "target": "es2017",
    "outDir": ".webpack"
  },
  "include": ["./**/*.ts"],
  "exclude": [
    "node_modules/**/*",
    ".serverless/**/*",
    ".webpack/**/*"
  ]
}

webpack.config.js

const path = require('path');
const slsw = require('serverless-webpack');
const nodeExternals = require('webpack-node-externals');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

module.exports = {
  context: __dirname,
  mode: 'development', // slsw.lib.webpack.isLocal ? 'development' : 'production',
  entry: slsw.lib.entries,
  devtool: 'cheap-module-eval-source-map', // slsw.lib.webpack.isLocal ? 'cheap-module-eval-source-map' : 'source-map',
  resolve: {
    extensions: ['.mjs', '.json', '.ts'],
    symlinks: false,
    cacheWithContext: false,
  },
  output: {
    libraryTarget: 'commonjs',
    path: path.join(__dirname, '.webpack'),
    filename: '[name].js',
  },
  target: 'node',
  externals: [nodeExternals()],
  module: {
    rules: [
      // all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
      {
        test: /\.(tsx?)$/,
        loader: 'ts-loader',
        exclude: [
          [
            path.resolve(__dirname, 'node_modules'),
            path.resolve(__dirname, '.serverless'),
            path.resolve(__dirname, '.webpack'),
            path.resolve(__dirname, 'data'),
            path.resolve(__dirname, 'e2e'),
            path.resolve(__dirname, 'localstack-data'),
          ],
        ],
        options: {
          transpileOnly: true,
          experimentalWatchApi: true,
        },
      },
    ],
  },
  plugins: [
    new ForkTsCheckerWebpackPlugin({
      eslint: true,
      eslintOptions: {
        cache: true
      }
    })
  ],
  optimization: {
    minimize: false,
  },
};

webpack output

Built at: 10/05/2021 16:26:17
         Asset     Size       Chunks             Chunk Names
lib/handler.js  171 KiB  lib/handler  [emitted]  lib/handler
Entrypoint lib/handler = lib/handler.js
[./lib/handler.ts] 910 bytes {lib/handler} [built]

curl -X POST http://localhost:4566/restapis/4lsj8aqf3g/local/user_request/graphql

{
	"errorType": "InvocationException",
	"errorMessage": "Lambda process returned error status code: 1. Result: {\"errorType\":\"Runtime.ImportModuleError\",\"errorMessage\":\"Error: Cannot find module '/var/task/lib/handler'\\nRequire stack:\\n- /var/runtime/UserFunction.js\\n- /var/runtime/index.js\"}. Output:\n2021-05-10T15:37:04.379Z\tundefined\tERROR\tUncaught Exception \t{\"errorType\":\"Runtime.ImportModuleError\",\"errorMessage\":\"Error: Cannot find module '/var/task/lib/handler'\\nRequire stack:\\n- /var/runtime/UserFunction.js\\n- /var/runtime/index.js\",\"stack\":[\"Runtime.ImportModuleError: Error: Cannot find module '/var/task/lib/handler'\",\"Require stack:\",\"- /var/runtime/UserFunction.js\",\"- /var/runtime/index.js\",\"    at _loadUserApp (/var/runtime/UserFunction.js:100:13)\",\"    at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)\",\"    at Object.<anonymous> (/var/runtime/index.js:43:30)\",\"    at Module._compile (internal/modules/cjs/loader.js:999:30)\",\"    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\",\"    at Module.load (internal/modules/cjs/loader.js:863:32)\",\"    at Function.Module._load (internal/modules/cjs/loader.js:708:14)\",\"    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)\",\"    at internal/main/run_main_module.js:17:47\"]}\n\u001b[32mSTART RequestId: 9401b9d2-aea5-1673-00d5-d4fcdd96508c Version: $LATEST\u001b[0m\n\u001b[32mEND RequestId: 9401b9d2-aea5-1673-00d5-d4fcdd96508c\u001b[0m\n\u001b[32mREPORT RequestId: 9401b9d2-aea5-1673-00d5-d4fcdd96508c\tInit Duration: 495.68 ms\tDuration: 2.69 ms\tBilled Duration: 3 ms\tMemory Size: 1536 MB\tMax Memory Used: 39 MB\t\u001b[0m",
	"stackTrace": [
		"  File \"/opt/code/localstack/localstack/services/awslambda/lambda_api.py\", line 602, in run_lambda\n    result = LAMBDA_EXECUTOR.execute(func_arn, func_details, event, context=context,\n",
		"  File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 176, in execute\n    return do_execute()\n",
		"  File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 168, in do_execute\n    return _run(func_arn=func_arn)\n",
		"  File \"/opt/code/localstack/localstack/utils/cloudwatch/cloudwatch_util.py\", line 149, in wrapped\n    raise e\n",
		"  File \"/opt/code/localstack/localstack/utils/cloudwatch/cloudwatch_util.py\", line 145, in wrapped\n    result = func(*args, **kwargs)\n",
		"  File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 159, in _run\n    raise e\n",
		"  File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 147, in _run\n    result = self._execute(func_arn, func_details, event, context, version)\n",
		"  File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 325, in _execute\n    result = self.run_lambda_executor(cmd, stdin, env_vars=environment, func_details=func_details)\n",
		"  File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 231, in run_lambda_executor\n    raise InvocationException('Lambda process returned error status code: %s. Result: %s. Output:\\n%s' %\n"
	]
}

My hunch tells me that it's an issue with how docker mounts the lambda code. I think for some reason it's empty and that's why it's not finding the handler defined in my serverless.ts.

created time in 7 days

PR opened microsoft/Power-Fx

Uniformity of writing style

The writing style is different from the sample in the image.

+1 -1

0 comment

1 changed file

pr created time in 8 days

issue commentlocalstack/serverless-localstack

Endpoint url is not shown when using localstack 0.12.5 or 0.12.6

Thanks for reporting @svenallers @simonNozaki . Looks like this is fixed with the latest versions - can you please give it another try with the latest version of the serverless-localstack, and the latest LocalStack Docker image? Thanks

$ sls --version
Framework Core: 2.40.0
Plugin: 4.5.3
SDK: 4.2.2
Components: 3.9.2
$ sls deploy --stage local
...
endpoints:
  http://localhost:4566/restapis/vj1e9rv0hi/local/_user_request_
svenallers

comment created time in 10 days