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

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

Closed
1 task
dac09 opened this issue Jun 29, 2022 · 3 comments
Closed
1 task

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

dac09 opened this issue Jun 29, 2022 · 3 comments

Comments

@dac09
Copy link
Contributor

dac09 commented Jun 29, 2022

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
@dac09 dac09 added bug/needs-info More information is needed for reproduction bug/confirmed We have confirmed this is a bug good first issue topic/deployment and removed bug/needs-info More information is needed for reproduction labels Jun 29, 2022
@redwoodjs-bot redwoodjs-bot bot added this to Main Jun 30, 2022
@redwoodjs-bot redwoodjs-bot bot moved this to Triage in Main Jun 30, 2022
@jtoar jtoar moved this from Triage to Backlog in Main Jul 7, 2022
@IThinkThatsKirby
Copy link
Contributor

I am currently investigating. Don't hold your breath, I'm slow.

IThinkThatsKirby added a commit to IThinkThatsKirby/redwood that referenced this issue Aug 26, 2022
@IThinkThatsKirby
Copy link
Contributor

IThinkThatsKirby commented Aug 29, 2022

After some poking around this morning it looks like an issue with windows pathing not being supported by nodeFileTrace. I will verify later today, then see if its easier to just make a work around on our end, or add a feature to nodeFileTrace.

might also be how our builder handles windows pathing as the only things not being traced are imports with \\

IThinkThatsKirby added a commit to IThinkThatsKirby/redwood that referenced this issue Aug 31, 2022
dac09 added a commit that referenced this issue Sep 5, 2022
* issue#5852 added windows fix for nodeFileTrace

* Update packages/internal/src/build/api.ts

unregexed.

Co-authored-by: Tobbe Lundberg <[email protected]>

* Update packages/internal/src/build/web.ts

unregexed

Co-authored-by: Tobbe Lundberg <[email protected]>

* issue# 5852 now only the import files are changed.

* issue #5852 only import files changed.

* Adds test for src-alias plugin - unlikely to work on Windows

Co-authored-by: Tobbe Lundberg <[email protected]>
Co-authored-by: Daniel Choudhury <[email protected]>
@dac09
Copy link
Contributor Author

dac09 commented Sep 5, 2022

Fixed by #6325

@dac09 dac09 closed this as completed Sep 5, 2022
Repository owner moved this from Backlog to Done in Main Sep 5, 2022
jtoar pushed a commit that referenced this issue Sep 8, 2022
* issue#5852 added windows fix for nodeFileTrace

* Update packages/internal/src/build/api.ts

unregexed.

Co-authored-by: Tobbe Lundberg <[email protected]>

* Update packages/internal/src/build/web.ts

unregexed

Co-authored-by: Tobbe Lundberg <[email protected]>

* issue# 5852 now only the import files are changed.

* issue #5852 only import files changed.

* Adds test for src-alias plugin - unlikely to work on Windows

Co-authored-by: Tobbe Lundberg <[email protected]>
Co-authored-by: Daniel Choudhury <[email protected]>
jtoar pushed a commit that referenced this issue Sep 8, 2022
* issue#5852 added windows fix for nodeFileTrace

* Update packages/internal/src/build/api.ts

unregexed.

Co-authored-by: Tobbe Lundberg <[email protected]>

* Update packages/internal/src/build/web.ts

unregexed

Co-authored-by: Tobbe Lundberg <[email protected]>

* issue# 5852 now only the import files are changed.

* issue #5852 only import files changed.

* Adds test for src-alias plugin - unlikely to work on Windows

Co-authored-by: Tobbe Lundberg <[email protected]>
Co-authored-by: Daniel Choudhury <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants