Camilo Rios
02/13/2021, 8:24 PMsst start
on a monorepo with the sample ts api example but getting an error. The debugger starts just fine, but as soon as I make an api request it fails.Camilo Rios
02/13/2021, 8:25 PMCamilo Rios
02/13/2021, 8:25 PMJay
Camilo Rios
02/13/2021, 10:26 PM12.13.0
npm: 6.12.0
Jay
Camilo Rios
02/13/2021, 10:44 PMJay
Camilo Rios
02/13/2021, 11:07 PMJay
Frank
GET /
but failed when it tried to spawn a process to run your local code.Frank
C:\Users\camil\Desktop\Temis\temis-core\services\rest-api\node_modules\@serverless-stack\cli\scripts\start.js
and around line 971, you should see const lambda = spawn(..
Frank
bootstrap.js
file which will import your lambda handler ./src/lambda.handler
Camilo Rios
02/13/2021, 11:37 PMFrank
lambda.on("exit", function() {..
which gets called after the spawned process exits.Frank
spawn
failed with the error EBADF: bad file descriptor, uv_pipe_open
and the exit
callback was invoked right away.Frank
Camilo Rios
02/13/2021, 11:54 PMFrank
Camilo Rios
02/14/2021, 11:08 AMFrank
sst build
worked on your local before?John Nguyen
02/14/2021, 8:59 PMCamilo Rios
02/14/2021, 9:40 PMCamilo Rios
02/14/2021, 9:41 PMFrank
sst build
and sst start
issue on a windows 10 machine (launch via AWS WorkSpaces).Frank
node v12.13.0
npm v6.12.0
PowerShell 5.1.14393.3866
I ran winver
in PS and it says "Windows Server 2016 Datacenter".Frank
npx create-serverless-stack@latest my-sst-app
cd my-sst-app
npx sst build
npx sst start
Frank
sst build
, I noticed the extra slash in your handlerFrank
Frank
npx create-serverless-stack@latest my-sst-app
cd my-sst-app
npx sst build
npx sst start
Camilo Rios
02/15/2021, 10:17 AMCamilo Rios
02/15/2021, 11:47 AMdefaultFunctionProps
. If I use the srcPath
it fails, but if I just define the full path in the routes it works. (I was following the example here https://docs.serverless-stack.com/constructs/Api#specifying-function-props-for-all-the-routes)Camilo Rios
02/15/2021, 11:52 AMyarn start
thoughCamilo Rios
02/15/2021, 12:03 PMnpx create-serverless-stack@latest my-sst-app
cd my-sst-app
npx sst build
npx sst start
Camilo Rios
02/15/2021, 12:04 PMCamilo Rios
02/15/2021, 12:21 PMFrank
build
and start
commands work for you when you tried the starter project?Camilo Rios
02/15/2021, 8:15 PMCamilo Rios
02/15/2021, 8:15 PMCamilo Rios
02/15/2021, 8:15 PMCamilo Rios
02/15/2021, 8:16 PMFrank
build
command fails if you use a srcPath
2. start
command fails in your monorepo setupFrank
Camilo Rios
02/15/2021, 8:19 PMFrank
Frank
sst start
issue? I can try to reproduce it on my windows setup.Camilo Rios
02/15/2021, 8:20 PMFrank
Camilo Rios
02/15/2021, 8:20 PMCamilo Rios
02/15/2021, 8:21 PMFrank
rest-api
service that's having the issue right?Camilo Rios
02/15/2021, 8:29 PMFrank
srcPath
and route handler set to when the build
command fails for you?Frank
srcPath
is currently commented outCamilo Rios
02/15/2021, 8:31 PM/src
Frank
"GET /": "src/lambda.handler"
?Camilo Rios
02/15/2021, 8:39 PMCamilo Rios
02/15/2021, 9:32 PMyarn start
issue only happens when trying it inside a monorepo. I tried different configurations (js and ts) but both throws the same error. I based the monorepo on this one https://github.com/AnomalyInnovations/serverless-lerna-yarn-starter but also other configurations, but with no luck. I haven't been able to pin point the problem, but I will let you know if I find something. Are you able to run it on your side inside a monorepo?Frank
Camilo Rios
02/15/2021, 9:54 PMCamilo Rios
02/15/2021, 9:55 PMFrank
Frank
build
command issue.Frank
srcPath: "src"
Frank
srcPath: "src/"
works on mac/linux, but fails on windowsFrank
Frank
start
command issue now.Frank
===================
Starting debugger
===================
Transpiling Lambda code...
Debug session started. Listening for requests...
Error: Failed to load plugin '@babel' declared in 'BaseConfig': Cannot find module '@babel/eslint-plugin'
Require stack:
- /Users/frank/Sites/fwang/temis-core/services/rest-api/__placeholder__.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.resolve (internal/modules/cjs/helpers.js:94:19)
at Object.resolve (/Users/frank/Sites/fwang/temis-core/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js:28:50)
at ConfigArrayFactory._loadPlugin (/Users/frank/Sites/fwang/temis-core/node_modules/@eslint/eslintrc/lib/config-array-factory.js:1017:39)
at /Users/frank/Sites/fwang/temis-core/node_modules/@eslint/eslintrc/lib/config-array-factory.js:908:33
at Array.reduce (<anonymous>)
at ConfigArrayFactory._loadPlugins (/Users/frank/Sites/fwang/temis-core/node_modules/@eslint/eslintrc/lib/config-array-factory.js:904:22)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/frank/Sites/fwang/temis-core/node_modules/@eslint/eslintrc/lib/config-array-factory.js:725:44)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (/Users/frank/Sites/fwang/temis-core/node_modules/@eslint/eslintrc/lib/config-array-factory.js:665:20) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/frank/Sites/fwang/temis-core/services/rest-api/__placeholder__.js'
],
messageTemplate: 'plugin-missing',
messageData: {
pluginName: '@babel/eslint-plugin',
resolvePluginsRelativeTo: '/Users/frank/Sites/fwang/temis-core/services/rest-api',
importerName: 'BaseConfig'
}
}
Camilo Rios
02/15/2021, 10:32 PMCamilo Rios
02/15/2021, 10:32 PMCamilo Rios
02/15/2021, 10:35 PMstart
issueFrank
rest-api
service out as a standalone repo, and removed TS.Frank
EBADF: bad file descriptor
errorFrank
Frank
Frank
npm init serverless-stack@latest my-sst-app --use-yarn
yarn start
Frank
@serverless-stack/cli
and @serverless-stack/resources
to version 0.9.3-next.1
in your package.json.Frank
build
issue when srcPath
is specified; and the EBADF: bad file descriptor
issue when running yarn start
Frank
Camilo Rios
02/16/2021, 10:17 AMCamilo Rios
02/16/2021, 10:36 AMFrank
Camilo Rios
02/16/2021, 11:05 AMCamilo Rios
02/16/2021, 11:05 AMCamilo Rios
02/16/2021, 11:05 AMFrank
npm init serverless-stack@next my-sst-app --language typescript --use-yarn
yarn build
Frank
Camilo Rios
02/16/2021, 11:10 AMCamilo Rios
02/16/2021, 11:15 AMFrank
rest-api
on yarn build
?Camilo Rios
02/16/2021, 11:21 AMrest-api
, but I removed the node_modules
and yarn.lock
and installed everything again and now its buildingCamilo Rios
02/16/2021, 11:21 AMyarn start
nowCamilo Rios
02/16/2021, 11:22 AMFrank
node_modules
and yarn.lock
fixed the typescript issue in monorepo?Camilo Rios
02/16/2021, 12:00 PMCamilo Rios
02/16/2021, 12:01 PMFrank
Frank
Camilo Rios
02/16/2021, 8:58 PM