Code Monkey home page Code Monkey logo

Comments (5)

timlindsk avatar timlindsk commented on May 14, 2024 2

Agreed, this bug silently broke redirection-links for us where we sometimes use different base-paths depending on the environment. I feel like we should be able to expect it to be evaluated as a string when set like one.
NEXT_PUBLIC_BASE_PATH=''

As a temporary fix we reverted to 14.1.4 in wait for a real fix

from next.js.

icyJoseph avatar icyJoseph commented on May 14, 2024 1

Nice catch! I've made a PR for it, hopefully it gets reviewed soon

from next.js.

icyJoseph avatar icyJoseph commented on May 14, 2024 1

It's pretty much an ordinary nextjs setup with NEXT_PUBLIC_BASE_PATH='' in .env, then I'm using it in a utilities function that's returning: ${window.location.origin}${process.env.NEXT_PUBLIC_BASE_PATH}, where it's then called from a function within a page component like: ${appURL()}${path} to create a url. All of which have worked fine before.

Alright, then yea I think this should also cover that.

from next.js.

icyJoseph avatar icyJoseph commented on May 14, 2024

Agreed, this bug silently broke redirection-links for us where we sometimes use different base-paths depending on the environment. I feel like we should be able to expect it to be evaluated as a string when set like one. NEXT_PUBLIC_BASE_PATH=''

As a temporary fix we reverted to 14.1.4 in wait for a real fix

@timlindsk hi, could you show us a small reproduction set of steps, or better yet a repository? I would like to verify that the proposed fix also fixes your issue.

from next.js.

timlindsk avatar timlindsk commented on May 14, 2024

It's pretty much an ordinary nextjs setup with NEXT_PUBLIC_BASE_PATH='' in .env, then I'm using it in a utilities function that's returning:
${window.location.origin}${process.env.NEXT_PUBLIC_BASE_PATH}, where it's then called from a function within a page component like: ${appURL()}${path} to create a url. All of which have worked fine before.

Sidenote, separate issue, while troubleshooting: I also stumbled upon an issue where compiling mui/icons-material ended up in a crash because "use strict"; was on top of "use client"; But I have yet to boil down the root of that problem, it seems to be related to a later version of nextjs, but I'm also not sure as what the best practice is regarding it, if they should be switched around by mui/icons-material I mean, or if nextjs should allow for it. Can't seem to find much about it other than the case where there's no "use client"; at all. Any pointer?

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.