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

"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'common/updatePreviousStep.js' #566

Open
rushikeshsane95 opened this issue May 5, 2021 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@rushikeshsane95
Copy link

Versions

SAM Version: 1.23.0
VS Code version: 1.46.1
AWS Toolkit extension version: 1.24.0

Question:

While trying to run a lambda functions locally, I am trying to refer to a file that exists in node_modules/ from index.js. Both have their package.json. This setup was working perfectly earlier on the local machine but started giving following error after I upgraded the SAM CLI.

Logs after local debug of lambda function:

2021-05-05T09:26:16.358Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'common/updatePreviousStep.js'\nRequire stack:\n- /var/task/channel/encoder/index.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js","stack":["Runtime.ImportModuleError: Error: Cannot find module 'common/updatePreviousStep.js'","Require stack:","- /var/task/channel/encoder/index.js","- /var/runtime/UserFunction.js","- /var/runtime/index.js"," at _loadUserApp (/var/runtime/UserFunction.js:100:13)"," at Object.load (/var/runtime/UserFunction.js:140:17)"," at Object. (/var/runtime/index.js:43:30)"," at Module._compile (internal/modules/cjs/loader.js:996:14)"," at Object..js (internal/modules/cjs/loader.js:1027:10)"," at Module.load (internal/modules/cjs/loader.js:863:32)"," at Function._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"]}
time="2021-05-05T09:26:16.361" level=panic msg="ReplyStream not available"
2021/05/05 09:26:16 http: panic serving 127.0.0.1:56240: &{0xc00018c070 map[] 2021-05-05 09:26:16.3616886 +0000 UTC m=+2.504963701 panic ReplyStream not available }
goroutine 54 [running]:
net/http.(*conn).serve.func1(0xc0002181e0)
/usr/local/go/src/net/http/server.go:1800 +0x139
panic(0x866640, 0xc00018c230)
/usr/local/go/src/runtime/panic.go:975 +0x3e3
github.com/sirupsen/logrus.Entry.log(0xc00018c070, 0xc0001990e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:259 +0x335
github.com/sirupsen/logrus.(*Entry).Log(0xc00018c1c0, 0xc000000000, 0xc00008f588, 0x1, 0x1)
/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:287 +0xeb
github.com/sirupsen/logrus.(*Logger).Log(0xc00018c070, 0xc000000000, 0xc00008f588, 0x1, 0x1)
/go/pkg/mod/github.com/sirupsen/[email protected]/logger.go:193 +0x7d
github.com/sirupsen/logrus.(*Logger).Panic(...)
/go/pkg/mod/github.com/sirupsen/[email protected]/logger.go:234
github.com/sirupsen/logrus.Panic(...)
/go/pkg/mod/github.com/sirupsen/[email protected]/exported.go:129
go.amzn.com/lambda/rapi/rendering.RenderInteropError(0x9097c0, 0xc0001f40e0, 0xc0001fe100, 0x902b60, 0xc00018ae40)
/LambdaRuntimeLocal/lambda/rapi/rendering/rendering.go:292 +0x9a
go.amzn.com/lambda/rapi/handler.(*initErrorHandler).ServeHTTP(0xc0000a40a0, 0x9097c0, 0xc0001f40e0, 0xc0001fe100)
/LambdaRuntimeLocal/lambda/rapi/handler/initerror.go:52 +0x519
net/http.HandlerFunc.ServeHTTP(0xc000094380, 0x9097c0, 0xc0001f40e0, 0xc0001fe100)
/usr/local/go/src/net/http/server.go:2041 +0x44
github.com/go-chi/chi.(*Mux).routeHTTP(0xc0000ae0c0, 0x9097c0, 0xc0001f40e0, 0xc0001fe100)
/go/pkg/mod/github.com/go-chi/[email protected]+incompatible/mux.go:431 +0x278
net/http.HandlerFunc.ServeHTTP(0xc0000a4030, 0x9097c0, 0xc0001f40e0, 0xc0001fe100)
/usr/local/go/src/net/http/server.go:2041 +0x44
go.amzn.com/lambda/rapi/middleware.RuntimeReleaseMiddleware.func1.1(0x9097c0, 0xc0001f40e0, 0xc0001fe100)
/LambdaRuntimeLocal/lambda/rapi/middleware/middleware.go:100 +0xea
net/http.HandlerFunc.ServeHTTP(0xc000094180, 0x9097c0, 0xc0001f40e0, 0xc0001fe100)
/usr/local/go/src/net/http/server.go:2041 +0x44
go.amzn.com/lambda/rapi/middleware.AccessLogMiddleware.func1.1(0x9097c0, 0xc0001f40e0, 0xc0001fe100)
/LambdaRuntimeLocal/lambda/rapi/middleware/middleware.go:77 +0x170
net/http.HandlerFunc.ServeHTTP(0xc0000941a0, 0x9097c0, 0xc0001f40e0, 0xc0001fe100)
/usr/local/go/src/net/http/server.go:2041 +0x44
go.amzn.com/lambda/rapi/middleware.AppCtxMiddleware.func1.1(0x9097c0, 0xc0001f40e0, 0xc0001fe000)
/LambdaRuntimeLocal/lambda/rapi/middleware/middleware.go:66 +0x77
net/http.HandlerFunc.ServeHTTP(0xc0000a22d0, 0x9097c0, 0xc0001f40e0, 0xc0001fe000)
/usr/local/go/src/net/http/server.go:2041 +0x44
github.com/go-chi/chi.(*Mux).ServeHTTP(0xc0000ae0c0, 0x9097c0, 0xc0001f40e0, 0xc0001fe000)
/go/pkg/mod/github.com/go-chi/[email protected]+incompatible/mux.go:70 +0x513
github.com/go-chi/chi.(*Mux).Mount.func1(0x9097c0, 0xc0001f40e0, 0xc0001fe000)
/go/pkg/mod/github.com/go-chi/[email protected]+incompatible/mux.go:298 +0x118
net/http.HandlerFunc.ServeHTTP(0xc0000943e0, 0x9097c0, 0xc0001f40e0, 0xc0001fe000)
/usr/local/go/src/net/http/server.go:2041 +0x44
github.com/go-chi/chi.(*Mux).routeHTTP(0xc0000ae060, 0x9097c0, 0xc0001f40e0, 0xc0001fe000)
/go/pkg/mod/github.com/go-chi/[email protected]+incompatible/mux.go:431 +0x278
net/http.HandlerFunc.ServeHTTP(0xc0000a40c0, 0x9097c0, 0xc0001f40e0, 0xc0001fe000)
/usr/local/go/src/net/http/server.go:2041 +0x44
github.com/go-chi/chi.(*Mux).ServeHTTP(0xc0000ae060, 0x9097c0, 0xc0001f40e0, 0xc00023e300)
/go/pkg/mod/github.com/go-chi/[email protected]+incompatible/mux.go:86 +0x2b2
net/http.serverHandler.ServeHTTP(0xc0000b4000, 0x9097c0, 0xc0001f40e0, 0xc00023e300)
/usr/local/go/src/net/http/server.go:2836 +0xa3
net/http.(*conn).serve(0xc0002181e0, 0x90a800, 0xc000228280)
/usr/local/go/src/net/http/server.go:1924 +0x86c
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2962 +0x35c
2021-05-05T09:26:16.363Z undefined ERROR Uncaught Exception {"errorType":"Error","errorMessage":"socket hang up","code":"ECONNRESET","stack":["Error: socket hang up"," at connResetException (internal/errors.js:609:14)"," at Socket.socketOnEnd (_http_client.js:458:23)"," at Socket.emit (events.js:326:22)"," at endReadableNT (_stream_readable.js:1241:12)"," at processTicksAndRejections (internal/process/task_queues.js:84:21)"]}
Waiting for the debugger to disconnect...
time="2021-05-05T09:26:16.375" level=error msg="Init failed" InvokeID= error="Runtime exited with error: exit status 129"
time="2021-05-05T09:26:16.375" level=error msg="INIT DONE failed: Runtime.ExitError"

@medikoo
Copy link
Contributor

medikoo commented May 5, 2021

@rushikeshsane95 I don't think it applies to this repository. It's not a SAM related project

@medikoo medikoo added the question Further information is requested label May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants