1

Getting error:

These dependencies were not found:
nuxt02  |
nuxt02  | * @aws-sdk/client-dynamodb in ./middleware/checkForRedirect.js
nuxt02  | * @aws-sdk/lib-dynamodb in ./middleware/checkForRedirect.js

screen shot of above report

I have these dependencies installed in package.json:

screenshot of dependencies, supposedly in package.json

Using nuxt version 2.0.0.

The node_modules folder has these libs installed: screenshot of libraries shown from library root node_modules down

The import statement (inside middleware): (from https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.ReadItem.html)

screenshot of imports in checkForRedirect.js

Why is the nuxt compiler throwing these errors?

Update: OK turns out the npm install on the docker container wasn't doing a full install (using cached info). That part is OK (libs found).

New errors however: screenshot of additional errors reported

I have found someone with a similar issue here:Error when using s3-sync-client and @aws-sdk/client-s3 with webpack in Electron project

And I am using the accepted answer (they are not using Nuxt however!) to try and get this thing to build:

screenshot of nuxt.config.js

(does not work, still getting same error)

greybeard
  • 2,249
  • 8
  • 30
  • 66
gvanto
  • 1,936
  • 3
  • 21
  • 26
  • please do not use images to show code or logs. – clay Aug 02 '23 at 14:51
  • ok noted. Was purely for formatting reasons (the editor's format for logs was pretty unreadable) – gvanto Aug 03 '23 at 12:31
  • 1
    You should use [Syntax highlighting for code](https://stackoverflow.com/editing-help#syntax-highlighting). Images make it difficult to copy the code or the error and investigate about it, and that causes almost no one to be interested in responding. – clay Aug 03 '23 at 15:11

1 Answers1

0

You have a typo in your import statement, it should be like this:

import { DynamoDBClient } from "@aws-sdk/client-dynamodb";

For the lib-dynamodb make sure you also have @aws-sdk/lib-dynamodb installed as it a separate package.

Leeroy Hannigan
  • 11,409
  • 3
  • 14
  • 31
  • Sorry that typo was somehow introduced before making post. Fixed the typo (error still same as before). Both lib-dynamodb and client-dynamodb are installed (as can be seen from the node_modules folder) – gvanto Aug 02 '23 at 08:05