sst icon indicating copy to clipboard operation
sst copied to clipboard

cannot run local lambda environment

Open lvindotexe opened this issue 1 year ago • 4 comments

I can run the project in dev, i can build and deploy it but whenever i run pnpm dlx sst dev to try lambda live development i get hit with this error

SST v2.40.1  ready!

➜  App:     app
   Stage:   al
   Console: https://console.sst.dev/local/app/al

✖  Checking for changes
   Error: Project not initialized
       at useProject (file:///home/al/Code/mono/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/project.js:21:15)
       at SsrFunction.bind (file:///home/al/Code/mono/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/constructs/SsrFunction.js:193:56)
       at new SsrFunction (file:///home/al/Code/mono/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/constructs/SsrFunction.js:55:14)
       at createServerFunctionForDev (file:///home/al/Code/mono/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/constructs/SsrSite.js:198:20)
       at new SsrSite (file:///home/al/Code/mono/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/constructs/SsrSite.js:84:41)
       at new AstroSite (file:///home/al/Code/mono/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/constructs/AstroSite.js:20:9)
       at EmptyStack.Site (file:///home/al/Code/mono/apps/app/.sst.config.1707307343565.mjs:16:20)
       at stack (file:///home/al/.local/share/pnpm/store/v3/tmp/dlx-419322/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/constructs/FunctionalStack.js:20:35)
       at App.stack (file:///home/al/.local/share/pnpm/store/v3/tmp/dlx-419322/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/constructs/App.js:500:16)
       at Object.stacks [as fn] (file:///home/al/Code/mono/apps/app/.sst.config.1707307343565.mjs:15:9)
       at synthInRoot (file:///home/al/.local/share/pnpm/store/v3/tmp/dlx-419322/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/stacks/synth.js:56:24)
       at async Module.synth (file:///home/al/.local/share/pnpm/store/v3/tmp/dlx-419322/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/stacks/synth.js:19:16)
       at async build (file:///home/al/.local/share/pnpm/store/v3/tmp/dlx-419322/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/cli/commands/dev.js:162:38)
       at async file:///home/al/.local/share/pnpm/store/v3/tmp/dlx-419322/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/sst/cli/commands/dev.js:300:13
       at async Promise.all (index 0)
       at async Object.handler (file:///home/al/.local/share/pnpm/store/v3/tmp/dlx-419322/node_modules/.pnpm/[email protected]_@aws-sdk+cr

currently have the project setup in a monorepo, i was able to recreate it

yes im running the command in the correct dir, im running pnpm dlx sst dev in mono/apps/app

lvindotexe avatar Feb 07 '24 12:02 lvindotexe

How come the sst.config.ts is not at the root? For reference, here is the monorepo structure we recommend — https://github.com/sst/sst/tree/master/examples/quickstart-standalone

jayair avatar Feb 09 '24 23:02 jayair

I saw this issue when using pnpm dlx. It got solved when using npx

fev4 avatar Mar 03 '24 17:03 fev4

I saw this issue when using pnpm dlx. It got solved when using npx

encountered this same issue but it works when using npx instead of pnpm dlx

princejoogie avatar Mar 26 '24 03:03 princejoogie

Experiencing the same problem but on a Windows machine. Linux works fine but when we tried starting an existing project in Windows it crashed with this error after sst dev (version 2.41.2). The sst.config.ts is in the root of the repository, everything works fine on Linux.

Edit: doesn't work with npx either.

arpadgabor avatar Mar 29 '24 08:03 arpadgabor