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

Using child processes messes source-maps #1039

Closed
sajithneyo opened this issue Jul 1, 2020 · 1 comment
Closed

Using child processes messes source-maps #1039

sajithneyo opened this issue Jul 1, 2020 · 1 comment

Comments

@sajithneyo
Copy link

Hi,

I used serverless-offline:5.12.1 until recently and upgraded to 6.4.0. As that version has a problem with re-compilng JS correctly I added useChildProcesses: true so when I change the code, the change reflects in dev server. But I noticed when errors are thrown, the error includes line numbers in thousands. That means the source-map is not working correctly, So I changed useChildProcesses: false and the errors give correct line numbers. But the problem is hot reloading does not work.

bellow line shows the type of error message lines I get with 6.4.0 with useChildProcesses: true

\\build\\service\\index.js:131133:15

bellow is my serverless.yml settings for serverless-offline

serverless-offline:
        prefix: verification-service
        printOutput: true
        noPrependStageInUrl: true
        useChildProcesses: true

plugins:

plugins:
    - serverless-webpack
    - serverless-offline
    - serverless-stack-output
    - serverless-iam-roles-per-function
    - serverless-domain-manager
    - serverless-aws-documentation

the expected behaviour is bellow, (ex; using useChildProcesses: false with 6.4.0)

build\\service\\webpack:\\verification-service.ts:205:23

clearly there's a difference in compiled files as seen in those outputs.

Environment

  • serverless version: 1.74.1
  • serverless-offline version: 6.4.0
  • node.js version: 12.17.0
  • OS: Windows 10

Is there any solution to this?

@sajithneyo
Copy link
Author

Solved the issue with adding import 'source-map-support/register'; into index.ts (where I export the functions)

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

No branches or pull requests

1 participant