-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Describe the issue
When I setup a fresh arc project
And I add a table
And I install the typescript plugin
And I run arc sandbox
Then I expect the dev-sandbox to start
But instead I get a bunch of errors
✘ [ERROR] Could not resolve "@aws-sdk/client-dynamodb"
node_modules/@architect/functions/src/tables/legacy.js:16:25:
16 │ let dynamo = require('@aws-sdk/client-dynamodb')
Steps to reproduce
With reproduce repo
https://github.com/Xiphe/architect-tables-typescript-issue
git clone [email protected]:Xiphe/architect-tables-typescript-issue.git
cd architect-tables-typescript-issue
npm i
npm start
OR from scratch
- run
npm init @architect your-appandcdinto your-app - run
npm install @architect/functions @architect/plugin-typescript @types/node - change your app.arc to this
@app test-arc @http get / @aws # profile default region us-west-2 architecture arm64 runtime typescript @plugins architect/plugin-typescript @tables people pplID *String - rename
src/http/get-index/index.mjsto./index.ts - change the contents of that file to
import { Context, APIGatewayProxyResult, APIGatewayEvent } from "aws-lambda"; import arc from "@architect/functions"; console.log(arc); // learn more about HTTP functions here: https://arc.codes/http export async function handler( event: APIGatewayEvent, context: Context, ): Promise<APIGatewayProxyResult> { // REST AS IS...
- run
npm start,arc sandboxorarc deploy - See errors in console
Compiling TypeScript ✘ [ERROR] Could not resolve "@aws-sdk/client-dynamodb" node_modules/@architect/functions/src/tables/legacy.js:16:25: 16 │ let dynamo = require('@aws-sdk/client-dynamodb') ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~ You can mark the path "@aws-sdk/client-dynamodb" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.
Expected behavior
I would expect the dev environment to start
Also since 11.x I would expect that I don't need to install the old aws client
Screenshots
Desktop
- OS: MacOS 13.4
- Node: 20.11
Metadata
Metadata
Assignees
Labels
No labels