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]: "Invalid URL String" error #792

Open
1 task done
simmbiote opened this issue May 24, 2024 · 1 comment · May be fixed by #793
Open
1 task done

[🐛 Bug]: "Invalid URL String" error #792

simmbiote opened this issue May 24, 2024 · 1 comment · May be fixed by #793
Labels
bug Something isn't working

Comments

@simmbiote
Copy link

simmbiote commented May 24, 2024

next-on-pages environment related information

System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103
CPU: (8) arm64 Apple M1
Memory: 8 GB
Shell: /bin/zsh
Package Manager Used: npm (10.2.4)

Relevant Packages:
@cloudflare/next-on-pages: 1.11.3
vercel: N/A
next: N/A (Nextjs 14.2.3)

Description

On a very simple page at /, I get "Invalid URL String." error.
Page exists at /src/app/page.tsx.

On debugging I found the error to come from the function applyRouteDest
The cause seems to be the invalid path? //[...slugs]?nxtPslugs=en-ZA
image

i18n is configured in next.config.js

const nextConfig = {
  i18n: {
    locales: ['en-ZA'],
    defaultLocale: 'en-ZA',
  },
....

Reproduction

Potentially, try set up internationalisation on a nextjs app:

  i18n: {
    locales: ['en-ZA'],
    defaultLocale: 'en-ZA',
  },

Pages Deployment Method

Pages CI (GitHub/GitLab integration)

Pages Deployment ID

37d9b237

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?
@simmbiote simmbiote added the bug Something isn't working label May 24, 2024
simmbiote added a commit to simmbiote/next-on-pages that referenced this issue May 24, 2024
Suggested fix for issue cloudflare#792, where `//` exists in this.path, causing an exception to break the page.
@simmbiote simmbiote linked a pull request May 24, 2024 that will close this issue
@dario-piotrowicz
Copy link
Member

Thanks a lot for the issue (and PR!) @simmbiote 🙏 ❤️

(I'm so very sorry for the ultra late reply! 😢 🙇 😓 )

Could you maybe share the source code of your app? (so that I could more easily validate your solution?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants