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?
- On a windows machine, setup deployment with
yarn rw setup deploy serverless
- Run a "pack" using
yarn rw deploy serverless --side api
- 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:
yarn rw deploy serverless --side api --pack-only
- 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?
What's not working?
When trying to deploy the API side using the serverless integration, builds on Windows deploy correctly, but have runtime errors.
How do we reproduce the bug?
yarn rw setup deploy serverlessyarn rw deploy serverless --side apiAnalysis
The other files references by the function aren't being pulled into the zipball.
You can see this is the case by doing:
yarn rw deploy serverless --side api --pack-only./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
nodeFileTraceor 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.0Are you interested in working on this?