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

Navigation not working on electron.js + next.js #16595

Closed
jambulud opened this issue Aug 26, 2020 · 5 comments · Fixed by #16650
Closed

Navigation not working on electron.js + next.js #16595

jambulud opened this issue Aug 26, 2020 · 5 comments · Fixed by #16650
Labels
good first issue Easy to fix issues, good for newcomers
Milestone

Comments

@jambulud
Copy link

jambulud commented Aug 26, 2020

Bug report

Describe the bug

When trying to navigate to a different page using next.js+ typescript + electron the click over the link does nothing

To Reproduce

  1. Download next.js with-electron-typescript example https://github.com/vercel/next.js/tree/canary/examples/with-electron-typescript
  2. Install modules: with-electron-typescript$ yarn
  3. Pack app: with-electron-typescript$ yarn pack-app
  4. Go to with-electron-typescript/dist/win-unpacked
  5. Execute (double click) ElectronTypescriptNext.exe
  6. Try to navigate to Home, About and With Initial Props

Expected behavior

The application should navigate to the specified page:

Click on home -- navigate to --> pages/home
Click on about -- navigate to --> pages/about
...and so on.

Screenshots

The links seems to be rendered properly, linking to file:///
image

the src of the scripts is /_next/... (file:///_next/...)
image

But if I go to Sources tab then it shows that the _next/ resources are under C://
image

Shouldn't the scripts' src in the first picture link to /C://_next/... instead of /_next/... to get file:///C:/_next/...?

System information

  • OS: Windows 10
  • Version of Electron.js: 7.1.7
  • Version of Next.js: 9.5.2 (latest)
  • Version of Node.js: 12.16.2
  • Version of yarn: 1.15.2

Additional context

  1. I tried using <base href="./" /> but it does not solve the routing issue because base tag does not work with absolute paths (like /about, /_next/) but with relative ones (./about, ./_next/)
  2. next.config.js basePath does not allow relative paths, so you cannot do basePath: './' to transform /about --> ./about
  3. Even tried with the "import empty css" hack Failed to load pages importing css #5203 (comment)
@jambulud jambulud changed the title Navigation not working on electron + nextjs Navigation not working on electron + next.js Aug 26, 2020
@jambulud jambulud changed the title Navigation not working on electron + next.js Navigation not working on electron.js + next.js Aug 26, 2020
@timneutkens timneutkens added the good first issue Easy to fix issues, good for newcomers label Aug 26, 2020
@Janpot
Copy link
Contributor

Janpot commented Aug 26, 2020

Same as #16456 ?

@McZenith
Copy link

Hi! I'm interested in this issue ☺️

@jambulud
Copy link
Author

As in #16456, downgrading to next@9.5.1 worked for me.

Cow258 added a commit to Cow258/next.js that referenced this issue Aug 30, 2020
- Added support for protocols other than http and https
- Added test case

Fixes vercel#16456, vercel#16595
@Timer Timer added this to the backlog milestone Sep 7, 2020
Cow258 added a commit to Cow258/next.js that referenced this issue Sep 11, 2020
- Added support for protocols other than http and https
- Added unit test
- Added integration test

Fixes vercel#16456
Fixes vercel#16595
Cow258 added a commit to Cow258/next.js that referenced this issue Sep 28, 2020
- Added support for protocols other than http and https
- Added unit test
- Added integration test

Fixes vercel#16456
Fixes vercel#16595
Cow258 added a commit to Cow258/next.js that referenced this issue Oct 26, 2020
- Added support for protocols other than http and https
- Added unit test
- Added integration test

Fixes vercel#16456
Fixes vercel#16595
@Timer Timer modified the milestones: backlog, iteration 12 Nov 3, 2020
@0re5ama
Copy link

0re5ama commented Oct 28, 2021

I have the same issue with Next 11.1.2

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants