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

Dist folder not created #86

Open
sayayinR opened this issue Oct 15, 2024 · 7 comments
Open

Dist folder not created #86

sayayinR opened this issue Oct 15, 2024 · 7 comments

Comments

@sayayinR
Copy link

Hi,
I'm sure this is just a documenatation issue but I'm trying out astro-shopify and with the existing config when I run npm run build, a dist folder is not created. I can see it has an adapter for vercel. I am testing this with Github pages and the build fails because it does not find dist folder. Can you please update docs or advise what I need to do?

Thank you!

@thomasKn
Copy link
Owner

Have you tried to follow this guide?

@sayayinR
Copy link
Author

Yes I have. That’s where I copied the Yaml file from.

@thomasKn
Copy link
Owner

You also need to update your astro config to generate a static build:

export default defineConfig({
  output: "static",
  // adapter: vercel(),
  integrations: [
    tailwind({
      config: {
        applyBaseStyles: false,
      },
    }),
    svelte(),
  ],
});

And then you will have to update the src/pages/products/[...handle].astro page to add the getStaticPaths() function.

@sayayinR
Copy link
Author

Sorry for the late response. What is the quickest way to get this up and running in a test prod env? I just need to test out the speed improvements with my website. So if I use netlify for the build, would I still have to change the settings to create a static build? I tried it already and it also throws an error because it cannot find the dist folder.

@sayayinR
Copy link
Author

Also, i changed the settings locally, just the ones in config file without adding the getStaticPaths function and I got the following error, is it because I need to add the function?

15:42:25 [WARN] `Astro.request.headers` is unavailable in "static" output mode, and in prerendered pages within "hybrid" and "server" output modes. If you need access to request headers, make sure that `output` is configured as either `"server"` or `output: 
"hybrid"` in your config file, and that the page accessing the headers is rendered on-demand.
15:42:25 [ERROR] [StaticClientAddressNotAvailable] `Astro.clientAddress` is only available when using `output: 'server'` or `output: 'hybrid'`. Update your Astro config if you need SSR features.

@sayayinR
Copy link
Author

sayayinR commented Nov 14, 2024

Well I was able to get this deployed and running with netlify and the adapter so dist is not the issue anymore. Only thing now is that it is missing CSS so all styles are broken.
Seems like an issue with the naming of the CSS and JS files. In the website it is referencing the files with a capital letter in the beginning while in the build I see they are all lower case.
Actually not sure if that is just part of the issue, when I view the source code on my local it is loading a lot more resources than what I see on the deployed site on netlify.

@sayayinR
Copy link
Author

sayayinR commented Nov 15, 2024

sorry for all the messages, finally got it working. CSS issue was because while troubleshooting I had added a value for base in the config file which I did not need. So it was creating a path for the assets that did not exist.

By the way, what do I need to do to get the checkout working? Does the theme have components for the checkout flow?

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

2 participants