-
-
Notifications
You must be signed in to change notification settings - Fork 463
CDK Construct - Wrong s3 paths generated when deploying from windows #1016
Comments
Probably this line needs to be changed to serverless-next.js/packages/serverless-components/nextjs-cdk-construct/src/index.ts Line 368 in 4c80140
Can you try to update this and see if it works? |
I made that change and it failed to deploy on creation of the deployment bucket. I changed it back and it deployed fine, but with the same path error as before |
I see, basically I think just some places need to use the posix path which use "/" separator, maybe it is in another line. @kirkness would probably know better since he originally wrote this? |
Hi @kostenickj, you say it failed to deploy when you made that fix, what was the error you saw in the logs? |
It's likely a simple fix, although without access to a windows machine myself it'll be a little tricky! Is the above error occurring after setting |
Cheers for clarifying @kostenickj. From what I can tell, it looks as if the trouble comes from the |
@kirkness Ill give this a go today, and let you know! |
I made a possible fix, looks like invalidation paths also need to use posix path: #1025. Though I also don't have windows machine I can use to test, hopefully it works. On a related note, we should probably also add at least an e2e test for windows and/or CDK so it doesn't break in the future |
Didn't have a chance to test yesterday, but i will give it a go today. |
Agreed on this - e2e tests would be great. Not sure how the current e2e are set up but it'd be nice to have the same setup across both. |
I am unable to get this to build correctly, so i will wait until a new alpha release before i can test further. |
Have published it, let me know if it works. Right now e2e tests work by just using a deployment script to manually execute |
Describe the bug
A backslash instead of a forward slash is generated on the static folder, as show below
![image](https://user-images.githubusercontent.com/17304343/115767323-dbcf1600-a35d-11eb-8cd2-ac42e2797bea.png)
Actual behavior
this causes CloudFront (and pretty much everything) to fail on everything in that folder and get 403's
Expected behavior
slash should point the right way, like this:
_next/static/
Steps to reproduce
Deploy with cdk construct on windows.
You can see below im using building from a different directory, although i dont know if that makes a difference.
Screenshots/Code/Logs
my builder:
![image](https://user-images.githubusercontent.com/17304343/115768023-9b23cc80-a35e-11eb-8ce5-45fc5dea73ef.png)
![image](https://user-images.githubusercontent.com/17304343/115768083-ae369c80-a35e-11eb-95ae-b0b6c199e4cf.png)
Versions
packages:
![image](https://user-images.githubusercontent.com/17304343/115767846-66b01080-a35e-11eb-84f6-21732f611c19.png)
Additional context
I am going to test on linux and see if it still happens.
By the way, renaming the folder in s3 to the correct structure fixes literally everything.
This error does NOT happen when using the serverless component version, only cdk construct.
Checklist
The text was updated successfully, but these errors were encountered: