Skip to content

Angular new browser-esbuild different behaviour with baseHref #26618

Closed

Description

@mpontreau

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

Hello,

As the Vite and Esbuild are out of the developer preview, I tried to use it for my company projects.
It works well except that for each of our apps we had a specific behaviour that we didn't notice before using Vite.

All our app are using a baseHref like this:
"baseHref": "/myapp/"

But all links to our apps are like this:
http://mydomain.com/myapp

What's happening without Vite and EsBuild is that the trailing "/" was automatically added (don't know by who exactly), and by using Vite and Esbuild, it's not added automatically anymore we are getting an error page:

The server is configured with a public base URL of /myapp/ - did you mean to visit /myapp/ instead?

Did you know about this behaviour (didn't find any issue about it) ?
Do you plan to fix it or are you considering that it is now a standard behaviour ?
Thanks for your answer !

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

The server is configured with a public base URL of /myapp/ - did you mean to visit [/myapp/](http://mydomain:9999/myapp/) instead?

Please provide the environment you discovered this bug in (run ng version)

Angular/cli 17.0.5
Node v18.13.0

Anything else?

No response

Activity

  1. transferred this issue fromangular/angularon Dec 8, 2023
  2. added 2 commits that reference this issue on Dec 8, 2023
    3247689
    ffeae66
  3. added 2 commits that reference this issue on Dec 8, 2023
    4b3a965
    3df3e58
  4. angular-automatic-lock-bot commented on Jan 8, 2024

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  5. locked and limited conversation to collaborators on Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions