shakyshane / dev-ip Goto Github PK
View Code? Open in Web Editor NEWFind a suitable IP host to view local websites on
License: MIT License
Find a suitable IP host to view local websites on
License: MIT License
I use browser-sync which use your code as a dependency. When I transpile my code with babel6 a get this error:
browser-sync/node_modules/dev-ip/lib/dev-ip.js: 'return' outside of function (41:8)
39 | var out = getIp();
40 | if (!out.length) {
> 41 | return console.log(messages.error);
| ^
42 | }
43 | console.log(getIp("cli"));
44 | }
If I remove return from the 41th line, everything is ok.
Could you verify my statement or fix this issue. Thans a lot.
Bonjour!
I use browser-sync, which uses this code as a dependency. I recently updated to node 18.0.0 without second thought and started getting the following error, where there was no external IP returned. The output looked like this:
[Browsersync] Access URLs:
----------------------------------
Local: http://localhost:3000
External: http://false:3000
----------------------------------
UI: http://localhost:3001
UI External: http://localhost:3001
----------------------------------
So I downloaded dev-ip, did some digging and it seems like for some reason address.family isn't returned as a string of IPv4
anymore, like in the original code, but as an integer 4.
Logging the addresses looks like this, without the unimportant bits:
{
address: '—',
netmask: '—,
family: 4,
mac: '—',
internal: false,
cidr: '—'
}
Any chance you could take a look? I've reverted back to node v17 in the meantime, but I feel like this problem might pop up for others as well.
I'm sorry if this isn't the most comprehensive ticket, I don't usually engage much with anything on github.
Cheers
Felix
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.