Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update google provider version, deprecate old stuff #312

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

allen-munsch
Copy link

@allen-munsch allen-munsch commented Mar 3, 2024

try to update github workflow, update, and deprecate unsupported versions

Example error showing the node 20 version:

03:48:13 jm@pop-os serverless-functions ±|main ✗|→ node_modules/.bin/serverless deploy --force
Compiling function "first"...
Uploading artifacts...
Artifacts successfully uploaded...
Updating deployment...
Checking deployment update progress...
...............Environment: linux, node 20.11.1, framework 3.38.0 (local), plugin 7.2.3, SDK 4.5.1
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Error: Deployment failed: RESOURCE_ERROR

     {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"400","ResourceErrorMessage":"Function failed on loading user code. This is likely due to a bug in the user code. Error message: Provided module can't be loaded.\nIs there a syntax error in your code?\nDetailed stack trace: ReferenceError: exports is not defined in ES module scope\n    at file:///workspace/index.mjs:42:1\n    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)\n    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)\n    at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)\n    at async getUserFunction (/layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/loader.js:93:30)\n    at async main (/layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/main.js:35:32)\nCould not load the function, shutting down.. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation."}
    at throwErrorIfDeploymentFails (/home/jm/projects/ccs-projects/infrastructure/serverless-functions/node_modules/serverless-google-cloudfunctions/shared/monitorDeployment.js:71:11)
    at /home/jm/projects/ccs-projects/infrastructure/serverless-functions/node_modules/serverless-google-cloudfunctions/shared/monitorDeployment.js:42:17
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

1 deprecation found: run 'serverless doctor' for more details

And after updating and fixing the exports:

03:53:13 jm@pop-os serverless-functions ±|main ✗|→ node_modules/.bin/serverless deploy --force
Compiling function "first"...
Uploading artifacts...
Artifacts successfully uploaded...
Updating deployment...
Checking deployment update progress...
.........................
Done...
Service Information
service: planeso-to-discord-webhook
project: asdfasdf-123123
stage: dev
region: us-east4

Deployed functions
first
  https://blahblah.cloudfunctions.net/planeso-to-discord-webhook-dev-first

Removing old artifacts...

1 deprecation found: run 'serverless doctor' for more details

Need a faster logging experience than CloudWatch? Try our Dev Mode in Console: run "serverless dev"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant