cdk-nextjs: .next folder missing from standalone.zip

Any ideas why .next folder is missing from standalone.zip?

+ zip -ryq1 /tmp/nextjs-cdk-build-cJGhSY/standalone/standalone.zip node_modules package.json server.cjs server.cjs.map server.js server.js.map
Bundling asset oam-web/Web/ImgOptFn/Code/Stage...

  packages/web/cdk.out/bundling-temp-132480d4ff30450d18988a5dd5e22b14df829e19d7adb24b82ca76b24a6077a3/index.js  1.3mb ⚠️      

⚡ Done in 2651ms

I am assuming that leads to this error:

“ENOENT: no such file or directory, open ‘/var/task/.next/required-server-files.json’”

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

Yes that is true although this issue is with the windows subsystem for linux

Supporting windows natively probably would increase interest in this project…if that happens to be a goal.

If it helps, I am using windows subsystem for linux do to the dependency on zip. Perhaps windows users like me aren’t the target audience here. If multiple platforms aren’t supported, I can move on. I was just trying to find an alternative to serverless-next.js

I believe it should be possible to get working on WSL. Ideally we would not be shelling out to zip and instead building the archive programatically.

My output is the same but Next runs okay when deployed:

+ zip -ryq1 /Users/cyber/dev/.sst/cdk.out/nextjs-cdk-build-Next-c863/standalone/standalone.zip common node_modules package.json web