You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The underline data can't pass type check when I run yarn build, it showed that Property 'data' does not exist on type 'string'. But the type is a union type, and the returned data is compatible with the third. type { data: { type: string; fields: Record<string, any>; dataType: "moveObject"; has_public_transfer?: boolean | undefined; }. Please help me to check how to pass build. Thanks
Error message
$ yarn build
yarn run v1.22.19
$ next build
info - Loaded env from /Users/qiwihui/Development/smart/scaffold-move/scaffold-sui/.env.local
info - Linting and checking validity of types ..Failed to compile.
./src/pages/index.tsx:80:26
Type error: Property 'data' does not exist on type'string | { digest: string; objectId: string; version: number; } | { data: { type: string; fields: Record<string, any>; dataType: "moveObject"; has_public_transfer?: boolean | undefined; } | { ...; }; owner: "Immutable" | ... 2 more ... | { ...; }; previousTransaction: string; storageRebate: number; reference: { ...;...'.
Property 'data' does not exist on type'string'.
78 | const nfts = nftObjects.filter(item => item.status === "Exists").map(item => {
79 |return {
> 80 | id: item.details.data.fields.id.id,
| ^
81 | name: item.details.data.fields.name,
82 | url: item.details.data.fields.url,
83 | description: item.details.data.fields.description,
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Project: https://github.com/NonceGeek/scaffold-move/tree/main/scaffold-sui
code location: https://github.com/NonceGeek/scaffold-move/blob/main/scaffold-sui/src/pages/index.tsx#L72
The underline
data
can't pass type check when I runyarn build
, it showed thatProperty 'data' does not exist on type 'string'
. But the type is a union type, and the returned data is compatible with the third. type{ data: { type: string; fields: Record<string, any>; dataType: "moveObject"; has_public_transfer?: boolean | undefined; }
. Please help me to check how to pass build. ThanksError message
Related object request and response
Request:
Response:
Beta Was this translation helpful? Give feedback.
All reactions