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

Meteor 3 changes the default behavior of Meteor.absoluteUrl() #12965

Closed
ToyboxZach opened this issue Jan 15, 2024 · 5 comments · Fixed by #12966
Closed

Meteor 3 changes the default behavior of Meteor.absoluteUrl() #12965

ToyboxZach opened this issue Jan 15, 2024 · 5 comments · Fixed by #12966
Labels
confirmed We want to fix or implement it Meteor 3 relates to Meteor 3
Milestone

Comments

@ToyboxZach
Copy link
Contributor

If no ROOT_URL is specified On Meteor 2
Metoer.absoluteUrl() returns localhost:3000
On Meteor 3
Metoer.absoluteUrl() returns 127.0.01:3000

What's worse is you can't even force ROOT_URL = localhost as it seems to override it at some point.

Is this on purpose?

It mostly is causing us tooling issues, but it is slightly annoying to our upgrade testing.

@Grubba27 Grubba27 added confirmed We want to fix or implement it Meteor 3 relates to Meteor 3 labels Jan 16, 2024
@Grubba27
Copy link
Contributor

Yes, we did that change, primarily because there was an issue with using localhost, with Node 16 > in Windows, from what I recall. We will do a revision on this, maybe this should only change for Windows.

@ToyboxZach
Copy link
Contributor Author

Ah got it. I am personally fine with it switching, it would just need to be explicitly mentioned in a changelog. And I think it is worth it being the same across all platforms.

At first glance it just seemed like an unnecessary change that was breaking our testing experience.

@ToyboxZach
Copy link
Contributor Author

If we decide it shouldbe different between windows and others, IMO it should just be suggested to use ROOT_URL=127.0.0.1 when running on windows, instead of changing how the actual code runs. Having it be different would make it more annoying for our experience, if we ever got a developer who worked on windows.

@Grubba27
Copy link
Contributor

It is being mentioned in the changelog:

- Async local storage was added to help deal with async methods.
- Added `promiseEmmiter` to help with async methods.
- Removed `fibers` from package.
- `Meteor.absoluteUrl` in localhost uses `127.0.1` by default.
.

You gave me a good idea. Run the windows tests exactly like you said, passing the argument ROOT_URL.

@ToyboxZach
Copy link
Contributor Author

Ah got it, didn't see that when I first looked at the changelog (its a pretty hefty change log and obviously not finished so understandable)

That phrasing does make me still feel like I could force ROOT_URL=http://localhost so could use some fixing up. Also there is a typo as the url would be 127.0.0.1 not 127.0.1

@StorytellerCZ StorytellerCZ added this to the Release 3.0 milestone Jan 16, 2024
@StorytellerCZ StorytellerCZ linked a pull request Jan 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed We want to fix or implement it Meteor 3 relates to Meteor 3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants