Giter Club home page Giter Club logo

Comments (7)

JamesMGreene avatar JamesMGreene commented on September 20, 2024

Thanks for the report, @TimPietrusky!

Do you happen to have a public repo available where you're running into this issue? ๐Ÿค” We haven't seen this behavior ourselves as far as I know, but definitely open to expanding our internal end-to-end tests if we're missing something. ๐Ÿ‘๐Ÿป

  • Update the comment in the provided workflow (nextjs.yml) to make sure that user know that this can be done (but I guess this is not the scope of this repo, pease let me know where this should be fixed)

The Next.js starter workflow template that GitHub suggests can be found in the actions/starter-workflows repo:
actions/starter-workflows@pages/nextjs.yml

from configure-pages.

JamesMGreene avatar JamesMGreene commented on September 20, 2024

One debugging step that would also help is to check what Pages site URL is being detected by the Action. This would help narrow down if the issue is in the values returned by the Pages REST API, a bug in our injection code, or some incompatibility between your Next.js config and our injection code.

To debug, update your Actions workflow with a few changes like the following:

      # Find your existing step for this, then add an `id` property
      - name: Setup Pages
        id: pages
        uses: actions/configure-pages@v3
        with:
          static_site_generator: next
      - name: Dump Pages configuration
        run: |
          echo PAGES_BASE_URL:  ${{ steps.pages.outputs.base_url }}
          echo PAGES_ORIGIN:    ${{ steps.pages.outputs.origin }}
          echo PAGES_HOST:      ${{ steps.pages.outputs.host }}
          echo PAGES_BASE_PATH: ${{ steps.pages.outputs.base_path }}

Although I'd like to fix whatever issue you're running into, it's probably also worth mentioning that you could probably use the aforementioned outputs values as a short-term workaround to, say, set environment variables for the duration of the workflow run that could then be used within your next.config.js when building/exporting your Next.js site. ๐Ÿ’ก

from configure-pages.

REDDOT007 avatar REDDOT007 commented on September 20, 2024

ok

from configure-pages.

TimPietrusky avatar TimPietrusky commented on September 20, 2024

@JamesMGreene thanks for your message!

The public repo where I was running into this is: https://github.com/iieinander/iieinander.band

Is there anything else that you need?

from configure-pages.

JamesMGreene avatar JamesMGreene commented on September 20, 2024

@TimPietrusky What I'm seeing in your Actions logs would suggest that the basePath is being set to "", which is the expected value for Next.js when there isn't any notable base path (trailing slashes are excluded). ๐Ÿค”

https://github.com/iieinander/iieinander.band/actions/runs/4173980364/jobs/7226978361#step:5:58

Extra line breaks added for legibility:

Found configuration object in indirect module export
Injection successful, new configuration:
/** @type {import('next').NextConfig} */
const nextConfig = {
  images: {unoptimized: true},
  experimental: {images: {unoptimized: true}},
  basePath: "",
  reactStrictMode: true,
  swcMinify: true,
};

module.exports = nextConfig;

from configure-pages.

TimPietrusky avatar TimPietrusky commented on September 20, 2024

@JamesMGreene yes, this is true, but only because I'm using my fork. When I used the original action, the basePath was set:

https://github.com/iieinander/iieinander.band/actions/runs/4166191535/jobs/7210202546#step:5:58

const nextConfig = {
  images: {unoptimized: true},experimental: {images: {unoptimized: true}},basePath: "/iieinander.band",reactStrictMode: true,
  swcMinify: true,
};

In my fork TimPietrusky@f294021, I commented out the basePath, so it's never set.

from configure-pages.

tyliec avatar tyliec commented on September 20, 2024

Noting that we ran into this same issue at https://github.com/CodeWithAloha/CWAWebsite, more info at CodeWithAloha/website#51

from configure-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.