Trying to use See for the first time - I'm hitting...
# seed
f
Trying to use See for the first time - I'm hitting an error, maybe something related to the upgrade to 0.59?
Copy code
npm ERR! notarget No matching version found for aws-cdk-lib@1.138.0.
I have the following in my package.json:
"dependencies": {
   
"aws-cdk-lib": "1.138.0",
   
"@serverless-stack/cli": "0.59.1",
   
"@serverless-stack/resources": "0.59.1"
f
Well, yes, I did read that - but I obviously am having a hard time here with those instructions. Probably something obvious - but I am not seeing what I screwed up.
Ok, I think I got further - the dependencies are now showing "aws-cdk-lib": "2.7.0" which is what it should have been before I bothered you (sorry). The problem now is when I run "npx sst diff" I get a bunch of errors:
Copy code
> react-scripts build

D:\Development\fasterbuddy\frontend\node_modules\react-scripts\config\webpack.config.js:664
        new MiniCssExtractPlugin({
        ^

TypeError: MiniCssExtractPlugin is not a constructor
    at module.exports (D:\Development\fasterbuddy\frontend\node_modules\react-scripts\config\webpack.config.js:664:9)
    at Object.<anonymous> (D:\Development\fasterbuddy\frontend\node_modules\react-scripts\scripts\build.js:58:16)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

Node.js v17.3.0

Error: There was a problem building the "ReactSite" StaticSite.
    at ReactStaticSite.buildApp (D:\Development\fasterbuddy\node_modules\@serverless-stack\resources\src\StaticSite.ts:203:15)
    at new StaticSite (D:\Development\fasterbuddy\node_modules\@serverless-stack\resources\src\StaticSite.ts:95:24)
    at new FrontendStack (D:\Development\fasterbuddy\stacks\FrontendStack.js:10:18)
    at Object.main (D:\Development\fasterbuddy\stacks\index.js:18:3)
    at Object.<anonymous> (D:\Development\fasterbuddy\.build\run.js:94:16)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)

Subprocess exited with error 1
t
that looks like an issue from your frontend, can you try blowing away nodemodules and reinstalling
f
Thanks for the quick reply - I'm pretty new at all of this, how do you blow away nodemodules and reinstall?
a
delete the
node_modules
directory inside your frontend app’s directory and then run
npm i
in the terminal from within the frontend app’s directory. This is the usual way to reinstall.
f
ok, I deleted
nodemodules
and ran
npm i
, but that command didn't seem to do much and the
nodemodules
directory did get not re-created. Ugh!
t
node_modules
?
I typoed it initially sorry
f
oh...
I guess that's what I deleted afterall based on what I found in my recycle bin. 😁
Well, I don't know what I did differently, but
npm i
finally worked. I did
npm list
first, which confirmed that I was missing dependencies, and then
npm i
and it is now fetching the missing dependencies.
f
@Francois Lachance is it deploying fine now on Seed?
f
I just tried again and got much further - unfortunately I think I've ran into a different problem:
Copy code
> frontend@0.1.0 build
> react-scripts build
/tmp/seed/source/frontend/node_modules/react-scripts/config/webpack.config.js:664
        new MiniCssExtractPlugin({
        ^
TypeError: MiniCssExtractPlugin is not a constructor
    at module.exports (/tmp/seed/source/frontend/node_modules/react-scripts/config/webpack.config.js:664:9)
    at Object.<anonymous> (/tmp/seed/source/frontend/node_modules/react-scripts/scripts/build.js:58:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47
Error: There was a problem building the "ReactSite" StaticSite.
    at ReactStaticSite.buildApp (/tmp/seed/source/node_modules/@serverless-stack/resources/src/StaticSite.ts:203:15)
    at new StaticSite (/tmp/seed/source/node_modules/@serverless-stack/resources/src/StaticSite.ts:95:24)
    at new ReactStaticSite (/tmp/seed/source/node_modules/@serverless-stack/resources/src/ReactStaticSite.ts:43:5)
    at new FrontendStack (/tmp/seed/source/stacks/FrontendStack.js:10:18)
    at Object.main (/tmp/seed/source/stacks/index.js:18:3)
    at Object.<anonymous> (/tmp/seed/source/.build/run.js:94:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
Error: Subprocess exited with error 1
    at ChildProcess.<anonymous> (/tmp/seed/source/node_modules/aws-cdk/lib/api/cxapp/exec.ts:127:23)
    at ChildProcess.emit (events.js:315:20)
    at ChildProcess.EventEmitter.emit (domain.js:467:12)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
There was an error synthesizing your app.
ERROR: Error: Subprocess exited with error 1
I think that's related to this: https://github.com/facebook/create-react-app/issues/11930
I got the same error when I did
npm run build
on my computer earlier today which I fixed by running
npm update mini-css-extract-plugin
. I'm not sure how to fix that in Seed.
f
Did running
npm update mini-css-extract-plugin
generate any changes in
package.json
and
package-lock.json
?
If you commit the changes and trigger a deploy on Seed, the changes to the npm modules will get picked up.