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

cannot run local lambda environment #3660

Open
lvindotexe opened this issue Feb 7, 2024 · 4 comments
Open

cannot run local lambda environment #3660

lvindotexe opened this issue Feb 7, 2024 · 4 comments

Comments

@lvindotexe
Copy link

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/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/node_modules/sst/project.js:21:15)
       at SsrFunction.bind (file:///home/al/Code/mono/node_modules/.pnpm/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/node_modules/sst/constructs/SsrFunction.js:193:56)
       at new SsrFunction (file:///home/al/Code/mono/node_modules/.pnpm/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/node_modules/sst/constructs/SsrFunction.js:55:14)
       at createServerFunctionForDev (file:///home/al/Code/mono/node_modules/.pnpm/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/node_modules/sst/constructs/SsrSite.js:198:20)
       at new SsrSite (file:///home/al/Code/mono/node_modules/.pnpm/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/node_modules/sst/constructs/SsrSite.js:84:41)
       at new AstroSite (file:///home/al/Code/mono/node_modules/.pnpm/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/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/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/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/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/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/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/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/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/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/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/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/sst@2.40.1_@aws-sdk+credential-provider-node@3.507.0/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/sst@2.40.1_@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

@jayair
Copy link
Contributor

jayair commented Feb 9, 2024

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

@fev4
Copy link

fev4 commented Mar 3, 2024

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

@princejoogie
Copy link
Contributor

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

@arpadgabor
Copy link
Contributor

arpadgabor commented Mar 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants