remix-run / grunge-stack

The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.
https://remix.run/stacks
MIT License
438 stars 95 forks source link

✘ [ERROR] Could not resolve "@aws-sdk/client-dynamodb" #193

Open valbaca opened 1 month ago

valbaca commented 1 month ago

Have you experienced this bug with the latest version of the template?

yes

Steps to Reproduce

Ran the following with alias pn=pnpm

valbaca@maxbook js % pn dlx create-remix@latest --template remix-run/grunge-stack

 remix   v2.12.1 πŸ’Ώ Let's build a better website...

   dir   Where should we create your new project?
         ./hello-grunge

      β—Ό  Template: Using remix-run/grunge-stack...
      βœ”  Template copied

   git   Initialize a new git repository?
         Yes

  deps   Install dependencies with pnpm?
         Yes

  init   This template has a remix.init script. Do you want to run it?
         Yes

      βœ”  Dependencies installed

      βœ”  Git initialized
      βœ”  Dependencies for remix.init script installed

      β—Ό  Running template's remix.init script...

? Do you want to run the build/tests/etc to verify things are setup properly? Yes

Expected Behavior

Successful startup after initial setup

Actual Behavior

valbaca@maxbook hello-grunge % pn dev

> hello-grunge-b2cc@ dev /Users/valbaca/Code/js/hello-grunge
> remix dev --manual -c "arc sandbox -e testing"

 πŸ’Ώ  remix dev

⚠️  Test routes enabled.
 info  building...
✘ [ERROR] Build failed with 4 errors:
node_modules/.pnpm/@architect+functions@8.1.6/node_modules/@architect/functions/src/tables/legacy.js:16:25: ERROR: Could not resolve "@aws-sdk/client-dynamodb"
node_modules/.pnpm/@architect+functions@8.1.6/node_modules/@architect/functions/src/tables/legacy.js:18:28: ERROR: Could not resolve "@aws-sdk/lib-dynamodb"
node_modules/.pnpm/@architect+functions@8.1.6/node_modules/@architect/functions/src/tables/legacy.js:24:25: ERROR: Could not resolve "aws-sdk/clients/dynamodb"
node_modules/.pnpm/@architect+functions@8.1.6/node_modules/@architect/functions/src/tables/legacy.js:57:40: ERROR: Could not resolve "@smithy/node-http-handler" [plugin css-bundle-plugin]

    app/root.tsx:20:30:
      20 β”‚ import { cssBundleHref } from "@remix-run/css-bundle";
         β•΅                               ~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onLoad" callback registered here:

    node_modules/.pnpm/@remix-run+dev@2.12.1_@remix-run+react@2.12.1_react-dom@18.3.1_react@18.3.1__react@18.3.1_typ_roc5sjsp5ppwfghrzndgv6kr4u/node_modules/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js:35:12:
      35 β”‚       build.onLoad({
         β•΅             ~~~~~~

    at setup (/Users/valbaca/Code/js/hello-grunge/node_modules/.pnpm/@remix-run+dev@2.12.1_@remix-run+react@2.12.1_react-dom@18.3.1_react@18.3.1__react@18.3.1_typ_roc5sjsp5ppwfghrzndgv6kr4u/node_modules/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js:35:13)
    at handlePlugins (/Users/valbaca/Code/js/hello-grunge/node_modules/.pnpm/esbuild@0.17.6/node_modules/esbuild/lib/main.js:1279:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

✘ [ERROR] Could not resolve "@aws-sdk/client-dynamodb"

    node_modules/.pnpm/@architect+functions@8.1.6/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. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.

✘ [ERROR] Could not resolve "@aws-sdk/lib-dynamodb"

    node_modules/.pnpm/@architect+functions@8.1.6/node_modules/@architect/functions/src/tables/legacy.js:18:28:
      18 β”‚     let docclient = require('@aws-sdk/lib-dynamodb')
         β•΅                             ~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@aws-sdk/lib-dynamodb" as external to exclude it from the bundle, which will remove this error. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.

✘ [ERROR] Could not resolve "aws-sdk/clients/dynamodb"

    node_modules/.pnpm/@architect+functions@8.1.6/node_modules/@architect/functions/src/tables/legacy.js:24:25:
      24 β”‚     let dynamo = require('aws-sdk/clients/dynamodb')
         β•΅                          ~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "aws-sdk/clients/dynamodb" as external to exclude it from the bundle, which will remove this error. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.

✘ [ERROR] Could not resolve "@smithy/node-http-handler"

    node_modules/.pnpm/@architect+functions@8.1.6/node_modules/@architect/functions/src/tables/legacy.js:57:40:
      57 β”‚       let { NodeHttpHandler } = require('@smithy/node-http-handler')
         β•΅                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@smithy/node-http-handler" as external to exclude it from the bundle, which will remove this error. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.
valbaca commented 1 month ago

I'm new to Remix Stacks, so not sure if this is known or not, figured I'd Open an Issue first.

I'm guessing it's an outdated architect and/or incompatibility with dynamodb

valbaca commented 1 month ago

Same issue when running with npx.

macOS, node v22.9.0

quantuminformation commented 1 week ago

del node mods, and lock file, re install ?