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
When trying to deploy a NextjsDistribution to AWS through a Windows environment, some commands doesn't from WSL doesn't work properly because of paths or syntax.
That happens when bundling the ImageOptimizationLambda and when building NextjsBuild.
Expected Behavior
Run cdk deploy, bundle and deploy the NextjsDistribution.
├ Running "yarn build" in <path>
$ next build
info - Linting and checking validity of types
info - Compiled successfully
info - Collecting page data
info - Generating static pages (3/3)
info - Finalizing page optimization
Route (pages) Size First Load JS
┌ ○ / 443 B 73.7 kB
├ /_app 0 B 73.3 kB
└ ○ /404 182 B 73.4 kB
+ First Load JS shared by all 73.3 kB
├ chunks/framework-2c79e2a64abdb08b.js 45.2 kB
├ chunks/main-0ecb9ccfcb6c9b24.js 27 kB
├ chunks/pages/_app-2855696d374eec2d.js 287 B
└ chunks/webpack-8fa1640cc84ba8fe.js 750 B
○ (Static) automatically rendered as static HTML (uses no initial props)
info - Creating an optimized production build ..+ cd /mnt/<path>/standalone
+ zip -ryq1 /mnt/c/Users/<user>/AppData/Local/Temp/standalone-IinlJm/standalone.zip .
Bundling asset DEV-Web-Admin-MAIN/<Stack_Name>-Web-Admin-ImageOpsLambda-DEV/Code/Stage...
D:\<path>\required-server-files.json
1 file(s) copied.
warning package.json: No license field
$ D:\<path>\node_modules\.bin\esbuild --bundle D:\<path>\node_modules\cdk-nextjs-standalone\assets\lambda\ImageOptimization\index.ts --target=node16 --platform=node --outfile=D:\<path>\cdk.out\bundling-temp-11162cfe73d40f0248812214cb3d7a6342de11bdaadacd770b227a07922345df\index.js --minify
cdk.out\bundling-temp-11162cfe73d40f0248812214cb3d7a6342de11bdaadacd770b227a07922345df\index.js 1.3mb
[Warning at /DEV-Web-Admin-MAIN/<Stack_Name>-Web-Admin-Distribution-DEV/DefaultOriginRequestEdgeFn/Fn] AWS Lambda has changed their authorization strategy, which may cause client invocations using the 'Qualifier' parameter of the lambda function to fail with Access Denied errors.
If you are using a lambda Version or Alias, make sure to call 'grantInvoke' or 'addPermission' on the Version or Alias, not the underlying Function
See: https://github.com/aws/aws-cdk/issues/19273
✨ Synthesis time: 21.61s
DEV-Certificate-MAIN (DEV-Certificate-ADMINWEB): building assets...
Current Behavior
Whenever bundling with Windows and WSL, deployment will throw an error with the .zip compression on NextjsBuild.ts at line 259 because paths syntax is different.
Then, fixing it, ImageOptimizationLambda.ts will fail at line 80 because cp is not recognize as a valid command (it is copy at windows environment)
Steps to Reproduce
Create a stack with all necessary constructs: Bucket, NextjsBuild, NextjsLayer, NextJsLambda, ImageOptimizationLambda and NextjsDistribution.
Context (Environment)
I am trying to do test deployments on my machine before creating a CI/CD to handle the deployment on AWS side, I was able to do the testing by manually changing those lines in node_modules, but would be cool to support it natively from the library.
The text was updated successfully, but these errors were encountered:
When trying to deploy a
NextjsDistribution
to AWS through a Windows environment, some commands doesn't from WSL doesn't work properly because of paths or syntax.That happens when bundling the
ImageOptimizationLambda
and when buildingNextjsBuild
.Expected Behavior
Run
cdk deploy
, bundle and deploy theNextjsDistribution
.Current Behavior
Whenever bundling with Windows and WSL, deployment will throw an error with the .zip compression on
NextjsBuild.ts
at line259
because paths syntax is different.Then, fixing it,
ImageOptimizationLambda.ts
will fail at line80
becausecp
is not recognize as a valid command (it iscopy
at windows environment)Steps to Reproduce
Bucket
,NextjsBuild
,NextjsLayer
,NextJsLambda
,ImageOptimizationLambda
andNextjsDistribution
.Context (Environment)
I am trying to do test deployments on my machine before creating a CI/CD to handle the deployment on AWS side, I was able to do the testing by manually changing those lines in
node_modules
, but would be cool to support it natively from the library.The text was updated successfully, but these errors were encountered: