Coder Social home page Coder Social logo

Comments (11)

timneutkens avatar timneutkens commented on May 18, 2024 7

We've opened a fix here: #64678

from next.js.

Gawdfrey avatar Gawdfrey commented on May 18, 2024 5

I bumped into this issue after upgrading to v14.2 just now. I have almost the exact same config as OP.
I guess this makes it so that the matcher is not respected and it applies to all routes? 🤔

from next.js.

jenewland1999 avatar jenewland1999 commented on May 18, 2024 3

+1, have the exact same issue with same config too. Seems to be a 14.2 specific thing.

from next.js.

balazsorban44 avatar balazsorban44 commented on May 18, 2024 2

It looks like the parsing is incomplete at:

JsValue::Array { items, .. } => {
for item in items {
if let Some(matcher) = item.as_str() {
matchers.push(matcher.to_string());
} else {
invalid_config(
"The matcher property must be a string or array \
of strings",
value,
);
}
}
}
🤔 It should also allow objects as an item of the matchers array.

from next.js.

ivandamyanov avatar ivandamyanov commented on May 18, 2024 1

I get the same issue when turning on --turbo with nextjs 14.2.1 with this matcher:

[
    {
      source: '/((?!api|_next/static|_next/image|__nextjs|.*\\..*|favicon.ico|auth/).*)',
      missing: [
        { type: 'header', key: 'next-router-prefetch' },
        { type: 'header', key: 'purpose', value: 'prefetch' },
      ],
    },
]

from next.js.

biohackerellie avatar biohackerellie commented on May 18, 2024 1

+1, have the exact same issue, exact same config

export const config = {
  matcher: [
    {
      source: "/((?!api|_next/static|_next/image|favicon.ico).*)",
      missing: [
        { type: "header", key: "next-router-prefetch" },
        { type: "header", key: "purpose", value: "prefetch" },
      ],
    },
  ],
};
Unable to parse config export in source file 
The exported configuration object in a source file need to have a very specific format from which some properties can be statically parsed at compiled-time.

from next.js.

kamalciirs avatar kamalciirs commented on May 18, 2024

Can you please check the issue reproduce example link is unavailable.

image

from next.js.

r34son avatar r34son commented on May 18, 2024

Can you please check the issue reproduce example link is unavailable.

Updated link

from next.js.

mwawrusch avatar mwawrusch commented on May 18, 2024

export const config = {
  matcher: [
    /*
     * Match all request paths except for the ones starting with:
     * - api (API routes)
     * - _next/static (static files)
     * - _next/image (image optimization files)
     * - favicon.ico (favicon file)
     */
    {
      source: '/((?!api|_next/static|_next/image|favicon.ico).*)',
      missing: [
        { type: 'header', key: 'next-router-prefetch' },
        { type: 'header', key: 'purpose', value: 'prefetch' },
      ],
    },
  ],
}

14.2.1

from next.js.

mwawrusch avatar mwawrusch commented on May 18, 2024

As always you guys rock. Thank you

from next.js.

jenewland1999 avatar jenewland1999 commented on May 18, 2024

Thanks @timneutkens and team! Appreciate the fix!

from next.js.

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.