https://serverless-stack.com/ logo
#guide
Title
# guide
b

Brian Merriman

04/05/2022, 2:00 AM
Seems
Copy code
fields: {
        userId: sst.TableFieldType.STRING,
        noteId: sst.TableFieldType.STRING,
      },
TableFieldType doesn't seem to exist anymore?
s

Seth Geoghegan

04/05/2022, 4:33 AM
Hmm, I'm seeing this too
Not sure why this is, but you can get around the issue by just using "string"
Copy code
const table = new sst.Table(this, "Notes", {
      fields: {
        userId: "string",
        noteId: "string"
      },
      primaryIndex: { partitionKey: "noteId", sortKey: "userId" },
    });
j

Janko Tomšič

04/05/2022, 12:33 PM
Same here, was checking the example from the guide and got the following error on build: Cannot read properties of undefined (reading ‘STRING’) Setting it to “string” worked, thnx @Seth Geoghegan
s

Seth Geoghegan

04/05/2022, 1:49 PM
This issue is related to the new 1.0 beta release. For the time being, consider using 0.69.x https://serverless-stack.slack.com/archives/C01JG3B20RY/p1649166093784879
f

Frank

04/06/2022, 3:53 PM
@Janko Tomšič @Seth Geoghegan yeah change the version for
@serverless-stack/cli
and
@serverless-stack/resources
to version
0.69.4
in ur package.json and run
npm/yarn install
.
We published the v1.0 beta to the
latest
npm tag, and when u run
create-serverless-stack
, it picks up the beta release.
Sorry about that.
It’s been reverted,
latest
points to
0.69.4
now
a

Alex Rayo

05/21/2022, 9:55 PM
What's the suggested usage now that v1.0 is out? Just a string literal
"string"
or is there a
TableFieldType.STRING
equivalent somewhere?