Skip to content

[Bug]: Running rw sls deploy on windows does not package src/lib #5852

@dac09

Description

@dac09

What's not working?

When trying to deploy the API side using the serverless integration, builds on Windows deploy correctly, but have runtime errors.

2022-06-29 15:18:20.288	ERROR	Uncaught Exception 	{"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '..\\..\\lib\\logger'\nRequire stack:\n- /var/task/api/dist/functions/nested/nested.js\n- /var/task/nested.js\n- /var/runtime/UserFunction.js\n- /var/runtime/Runtime.js\n- /var/runtime/index.js"

How do we reproduce the bug?

  1. On a windows machine, setup deployment with yarn rw setup deploy serverless
  2. Run a "pack" using yarn rw deploy serverless --side api
  3. Execute the function by going to the endpoint, and you will see the error above

Analysis
The other files references by the function aren't being pulled into the zipball.

You can see this is the case by doing:

  1. yarn rw deploy serverless --side api --pack-only
  2. Unzipping one of the zipballs in ./api/dist/zipball/[functionName].zip - and you will notice "src/lib" is missing - this is where logger, db, etc. usually sit.

It likely is an issue with how we call nodeFileTrace or how we handle the result of running that.

What's your environment? (If it applies)

System:
    OS: Windows 10 10.0.19042
  Binaries:
    Node: 14.17.4 - ~\AppData\Local\Temp\xfs-3228c060\node.CMD
    Yarn: 3.2.1 - ~\AppData\Local\Temp\xfs-3228c060\yarn.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (102.0.1245.44)
  npmPackages:
    @redwoodjs/core: 2.0.0 => 2.0.0

Are you interested in working on this?

  • I'm interested in working on this

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions