```Module '"@serverless-stack/resources"' has no e...
# help
f
Copy code
Module '"@serverless-stack/resources"' has no exported member 'TableFieldType'.ts(2305)
m
Copy code
new Table(this, "Notes", {
  fields: {
    userId: TableFieldType.STRING,
    noteId: TableFieldType.STRING,
  },
  primaryIndex: { partitionKey: "noteId", sortKey: "userId" },
});
using this?
f
Yeah
m
@Francis Menguito in V1, you don't need to import anything you can simply specify as a
string
f
Ohh
Cool
m
Copy code
new Table(this, "Notes", {
  fields: {
    userId: "string",
    noteId: "string",
  },
  primaryIndex: { partitionKey: "noteId", sortKey: "userId" },
});
f
Does this look right? @manitej
m
looks like you're not using V1
f
@manitej
I’m trying to do it in
ts
m
oh cool, you're not using functional stacks it seems
f
Documentation not updated?
m
yeah the guide needs to be updated (which is in progess!) I'd recommend you to follow this example: https://serverless-stack.com/examples/how-to-use-dynamodb-in-your-serverless-app.html
@Francis Menguito let me know if u face any difficulties. you can watch this for reference:

https://youtu.be/cqzgAJvUQCg

f
Thank you so much!
Will review this video
m
you'll love the new approach :))
f
I’m kinda new to this so please bare with me. Hehe
f
@Francis Menguito yeah you can just use “string”. Also u shouldn’t need to import
Construct
. You can use
<http://sst.App|sst.App>
as the scope, for example:
Copy code
import { App } from "@serverless-stack/resources;

...

constructor(scope: App, id: string, props: StackProps) {

...
h
Construct
is mistakenly gettting picked up by IDE when we ask it to infer types. This is happening because the guide is in js but we are implementing in TS