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

Endless compilation loop with serverless-offline #463

Closed
deanc opened this issue May 10, 2023 · 1 comment
Closed

Endless compilation loop with serverless-offline #463

deanc opened this issue May 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@deanc
Copy link

deanc commented May 10, 2023

Describe the bug
When creating a syntax error when combined with serverless-offline with --reloadHandler flag we are experiencing incredibly high CPU and memory usage. Screenshot attached. The error log you see at the bottom of the issue happens several times a second in a loop.

Screenshot 2023-05-10 at 13 33 35

  • OS: MacOS (Latest)
  • Plugins
"serverless": "^3.30.1",
"serverless-esbuild": "^1.44.0",
"serverless-offline": "^12.0.4",

Plugin configuration:

  esbuild:
    bundle: true
    minify: true
    sourcemap: true
    packager: 'yarn'
    exclude: ['aws-sdk']
    external: ['oracledb', 'tedious', 'pg', 'mysql', 'better-sqlite3', 'sqlite3', 'pg-query-stream']

Screenshot 2023-05-10 at 13 32 18

@deanc deanc added the bug Something isn't working label May 10, 2023
@deanc
Copy link
Author

deanc commented May 10, 2023

Alright I think I know what is going on here. Sorry for the quick turnaround. I am guessing that somewhere in our file system some JS files are being compiled and because the default settings for watch.patterns is ./**/*.(js|ts) it is picking up the compiled JS files somewhere. After changing this to ./**/*.ts (we are entirely TS codebase) the issue stopped.

Maybe it's worth adding a note to the docs

@deanc deanc closed this as completed May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant