question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support router in hash mode (spa)

See original GitHub issue

Environment


  • Operating System: Darwin
  • Node Version: v14.19.1
  • Nuxt Version: 3.0.0-rc.1
  • Package Manager: yarn@1.22.18
  • Builder: vite
  • User Config: ssr, app, typescript
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Describe the bug

How to config nuxt 3 router to use hash-mode?

I know the docs is not finished yet, so I searched the source code, but it seems there is no way to use the createWebHashHistory

https://github.com/nuxt/framework/blob/0eebb0a390c53c05c5bcbcb4fbda64d59a8945b6/packages/nuxt/src/pages/runtime/router.ts#L64

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

14reactions
1istencommented, Apr 25, 2022

I want to use Nuxt 3 to build an SPA and pack it into a desktop app using Electron. According to the vue-router docs, hash mode is

Useful for web applications with no host (e.g. file://) or when configuring a server to handle any URL isn’t an option.

2reactions
o1labcommented, Aug 26, 2022

Ahh we need this badly - we’re almost through with migrating to nuxt3 and are struggling with this 😭

@danielroe : can you please help ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why using hash based urls in your React SPA will save you ...
Implement Hash Based Url in React​​ In order to implement the hash based url in our SPA with React I choose to use...
Read more >
Fixing SPA Routing in History mode | by Sami C. - Medium
The default mode for vue-router is hash mode - it uses the URL hash to simulate a full URL so that the page...
Read more >
Maintaining Route Information During SPA (Single-Page ...
The benefit of the Hash mode routing is that is incurs significantly less technical complexity: You don't have to worry about History support...
Read more >
History API Routing for SPAs using webpack-dev-server
Most SPA-Routers support several modes of routing, e.g. hash-based routing of the form example.org/#/my/route (e.g. React Router's ...
Read more >
Different History modes - Vue Router
The history option when creating the router instance allows us to choose among different history modes. Hash Mode #. The hash history mode...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found