0

I'm facing a very common issue on Google cloud after deployment. I'm getting Cannot find module '/workspace/server.js'. In local it's working fine but not on gcloud. Tried lot of solutions from google but not able to get it. Please do provide me if any suggestion to make it work.

Here is my directory and config:

Build directory

enter image description here

Yaml config

runtime: nodejs16 # or another supported version
instance_class: B1
service: adminoper
basic_scaling:
  max_instances: 1
  idle_timeout: 10m

handlers:
- url: /
  static_dir: build

- url: /.*
  secure: always
  redirect_http_response_code: 301
  script: auto

Google cloud error

enter image description here

I got few answers in google to add entrypoint path but that's not working. Please do suggest.

David
  • 539
  • 3
  • 9
  • 23
  • was your package.json file deployed? Does it include module in the error message? – NoCommandLine Nov 21 '22 at 15:48
  • I'm pushing build folder, does package.json is mandatory? If yes do I need to paste it manually beside build folder? bcz webpack build doesn't push package.json I believe – David Nov 21 '22 at 15:54
  • okay, don't know about build folder. It looks to me like you're using GAE Standard. If so, as far as I know, GAE will install the contents of your package.json when it tries to run your App - https://cloud.google.com/appengine/docs/standard/nodejs/runtime#node.js-16 – NoCommandLine Nov 21 '22 at 16:04

0 Answers0