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

Example not working on Firefox. #4

Open
uyasarkocal opened this issue Dec 23, 2018 · 2 comments
Open

Example not working on Firefox. #4

uyasarkocal opened this issue Dec 23, 2018 · 2 comments

Comments

@uyasarkocal
Copy link

Example works well on Google Chrome, gives error and a blank page on Firefox.

Dev console error output:
SyntaxError: invalid regexp group

Related

@uyasarkocal
Copy link
Author

uyasarkocal commented Dec 27, 2018

Update:
It's not about any look-ahead, there is none. It's the named capturing group that brakes the page. I'm trying to make a search that queries anything written.

The route below works as expected in chrome, still not working on Firefox and other browsers.

{
      name: 'searchSw',
      path: '/search-sw',
      component: () => import('./View.vue'),
      smart: {
        matcher: {
          search: [/(?<query>.*)/] ,
          async routes({
            query
          }) {
            if (query.length < 2) return [];
            const data = await fetch(
              `https://swapi.co/api/people/?search=${encodeURIComponent(query)}`
            ).then(r => r.json());
            return data.results.map(person => ({
              name: 'character',
              title: `Go to character *${person.name}*`,
              params: {
                id: +person.url.match(/\/(\d+)\//, '$1')[1]
              }
            }));
          }
        }
      }
    }

How can I pass the query to the vue-smart-route without a named capturing group? Can you take a look @f ?

@seth100
Copy link

seth100 commented Oct 18, 2019

Same issue to me with nuxt.js after generating the project

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