« first day (3700 days earlier)      last day (1231 days later) » 

12:06 AM
posted on December 02, 2020 by Ben Mason

Hi everyone! We've just released Chrome Beta 87 (87.0.4280.86) for Android: it's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Ben Mason Google Chrome

 
anyone have an idea on how i could do the following in ts? not really sure what to search
interface ConfettiFile {
    pre?: string[];
    build?: string[];
    [key: string]: {
        pre?: string[];
        build?: string[];
    }
}
the key can be any string, but if its pre or build then the type is string[] otherwise its the object type
 
12:33 AM
@JBis weirdly I expected it to work like that
 
doesn't work for some reason
 
union types seem to work tho
 
yep thats what im going with for now
export type ConfettiFile = {
    [key: string]: {
        pre?: string[];
        build?: string[];
    };
} & {
    pre?: string[];
    build?: string[];
};
so ugly
 
^^
 
12:50 AM
been writing code for hours without running. Chances this works first try?
 
probably quite good if you have sufficient knowledge and using typescript which already filters a lot errors
50:50
maybe 20:80 if you are getting tired (at least thats where I start to add much more errors)
 
fail fail
 
next time
 
1:06 AM
posted on December 02, 2020 by Ben Mason

Hi, everyone! We've just released Chrome 87 (87.0.4280.86) for Android: it'll become available on Google Play over the next few weeks. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Ben Mason Google Chrome

 
 
3 hours later…
4:23 AM
so I have to define a standard set of tools / frameworks for an agency moving forward
primarily ecom sites, but some fun customizations here and there
 
why this dynamic import doesn't work in React ?
import AppConfig from 'App.config.json';
const Logo = React.lazy(() => import(AppConfig.Header.Logo));
it says
 Uncaught Error: Cannot find module 'us.common/components/Logo'
but if i put
'us.common/components/Logo'
inside import, it works the normal way
 
4:52 AM
@phenomnomnominal Why'd you use a custom error here? github.com/phenomnomnominal/betterer/blob/…
 
 
3 hours later…
8:06 AM
hi guys
i have problem with material ui in react-js
anyone can help me?
 
@MiladJurablu Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
i want ot change the arrow down color of the textfield in material ui but i dont know how
 
8:28 AM
@MiladJurablu you are using the native select (native: true), therefore you also need to style the native select, see e.g. here: stackoverflow.com/questions/14218307/select-arrow-style-change
 
@Sandro Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
8:41 AM
@Sandro tnx but i dont get that
 
remove the native true part.
 
 
6 hours later…
2:21 PM
@JBis
  const [categoryData, setCategoryData] = useState([]);
  const [eventData, setEventData] = useState([]);
  const [selectedCategory, setSelectedCategory] = useState([]);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    const url = 'https://eonet.sci.gsfc.nasa.gov/api/v3/categories';
    fetch(url)
      .then((res) => res.json())
      .then((data) => {
        setCategoryData(data.categories);
        setSelectedCategory(data.categories[0]);
        setLoading(false);
      });
I am getting an error
 
close but no. What error are you getting?
 
SyntaxError: Unexpected token < in JSON at position 0
because setSelectedCategory is not resolved on the first
 
well my guess is that selectedCategory.link has a URL that is HTML not JSON
 
I am using debugger
on the first page load
 
useEffect(() => {
    if(!selectedCategory){
       return;
    }
    const url = selectedCategory.link;

    fetch(url)
      .then((response) => response.json())
      .then((data) => {
        setEventData(data.events);
      })
      .catch((err) => alert(err));
  }, [selectedCategory]);
thats one option
but i'd just add it to the fetch
 
2:24 PM
everything from the first useEffect was skipped
default js behavior
 
?
 
and because of that , url is undefined
 
its asynchronous
 
I don't know how to explain
 
try what i suggested
 
2:26 PM
That will work
but why setSelectedCategory is not resolved on the first page load
but after the second useEffect
 
useEffect(() => {
    const url = 'https://eonet.sci.gsfc.nasa.gov/api/v3/categories';
    fetch(url)
      .then((res) => res.json())
      .then((data) => {
        setCategoryData(data.categories);
        setSelectedCategory(data.categories[0]);
        setLoading(false);
      })
      .then(fetch(selectedCategory.link))
      .then((response) => response.json())
      .then((data) => {
        setEventData(data.events);
      })
      .catch((err) => alert(err));;
  }, []);
try that
you may need to cache it because of react but not sure
 
just a moment , I will try
TypeError: Cannot read property 'json' of undefined
 
correction:
 
but when I confirm alert box with ok
everything is fetched
 
.then(() => fetch(selectedCategory.link))
 
2:35 PM
the same
SyntaxError: Unexpected token < in JSON at position 0
but after everything is fetched
 
ok well first off stop using alert for debugging. What is the value of selectedCategory.link?
 
undefined
on the first page load
 
no, im saying in the then statement
 
Compiled with warnings.

src/app/App.js
Line 28:6: React Hook useEffect has a missing dependency: 'selectedCategory.link'. Either include it or remove the dependency array react-hooks/exhaustive-deps
I need to go
Thank you for your effort
We will talk later
ok?
 
2:55 PM
hmm yeah, i guess you'd have to split it up. Or cache it. I'd probably cache it.
 
eli
I have cookies from my spring REST api running at localhost:8080 and my nuxt app running at localhost:8000. When i try my rest api with postman cookies are saved and transmitted to request successfully. But with front end cookies get received but not saved in cookies storage
I have tried to go through documentation i found that cookies are distibuted in both host ports. But i can not understand why it is not saving in my browser
 
hello
I have a game I'm coding at codesandbox.io/s/still-fog-u8req?file=/script.js, and I could use some pointers on where to start in terms of generating more falling squares, anyone up for it?
 
3:46 PM
0
Q: Generate more falling ''eggs" as a 'catch the eggs' game progresses?

LlamaButtI'm using javascript and an HTML canvas to make an egg drop game, and the scoring works fine, the paddle is movable, and the eggs are falling infinitely, however, they are only falling infinitely because there is only one egg that goes to the top of the screen and a random x position once it has ...

 
4:15 PM
Hey all, do most of the popular module javascript bundlers (i.e. Webpack, Browserify, etc.) require that we use Node.js? I'm asking because I'm developing ASP.NET Core application on Visual STudio 2019, and I do Not want to waste space, or add complexity to my project by adding Node.js?
Are there any popular module javascript bundlers that do Not require Node.js ?
 
4:26 PM
@crazyTech could I get some help with this stackoverflow.com/questions/65111413/…
 
hey guys
 
hey
coudl i get a little help with this?stackoverflow.com/questions/65111413/…
 
@JBis how to cache ?
I didn't do that
 
i take it back, i'd go with two seperate useEffect
 
hello
 
4:38 PM
  useEffect(() => {
    const url = 'https://eonet.sci.gsfc.nasa.gov/api/v3/categories';
    fetch(url)
      .then((res) => res.json())
      .then((data) => {
        setCategoryData(data.categories);
        setSelectedCategory(data.categories[0]);
        setLoading(false);
      });
  }, []);

  useEffect(() => {
     if(!selectedCategory){
       return;
    }
    const url = selectedCategory.link;

    fetch(url)
      .then((response) => response.json())
      .then((data) => {
        setEventData(data.events);
something like that should work
 
anybody knows that, react adds `px` at end of integer value passed in style props object
cool huh
 
Yes, that will work
 
0
Q: Generate more falling ''eggs" as a 'catch the eggs' game progresses?

LlamaButtI'm using javascript and an HTML canvas to make an egg drop game, and the scoring works fine, the paddle is movable, and the eggs are falling infinitely, however, they are only falling infinitely because there is only one egg that goes to the top of the screen and a random x position once it has ...

 
why why we need to chech if!selectedCategory
 
don't repeatedly link your question please
 
4:39 PM
why it's not resolved from the first useEffect ?
 
@MileMijatović fetch is asynchronous, so the second useEffect will be ran before the fetch result is returned
 
Thanks
 
Anyone else gets a white screen IE11 when trying to serve Angular app? I am using the ES5 config??
It works for my friends using IE11 but when I try to build and serve it I get a blank page
 
hello guys,
 
haven't opened IE11 in a while
 
4:42 PM
export const To_do_practice1 = () => {
    const [state, setState] = useState([])
    const clickHander = ()=> {

        let row = <li key={Math.random()}> Hello list </li>
        setState(()=> {
            let result = [...state, row]

            return result;
        })
    }
    return (
        <Fragment>
            <h1 className="text-center">
                Hello Redux practice 1
            </h1>
            <button onClick={ clickHander}>
                 Click Me
            </button>
 
hey
 
@KevinB Lucky you :P
 
can someone tell how can I use here key attribute, existing one is wrong way. I just add random number but I don't know how can I generate key there.
 
@JBis
if (!selectedCategory) {
return;
}
does not work
if (selectedCategory) {
  return;
}
work
 
that doesn't make sense
 
4:47 PM
I don't know what's happening
 
1 message moved to Trash can
 
  useEffect(() => {
    const url = 'https://eonet.sci.gsfc.nasa.gov/api/v3/categories';
    fetch(url)
      .then((res) => res.json())
      .then((data) => {
        setCategoryData(data.categories);
        setSelectedCategory(data.categories[0]);
        setLoading(false);
      });
  }, []);

  useEffect(() => {
    if (!selectedCategory) {
      return;
    }
    const url = selectedCategory.link;

    fetch(url)
      .then((response) => response.json())
      .then((data) => {
        setEventData(data.events);
 
@LlamaButt this is your final warning. do not continue to post the link.
 
the same error as before
 
okayy
 
4:48 PM
if (!selectedCategory) means if false is true
I will share my screen to you if you want ?
@jbis
 
no
create an mcve
|| mcve
 
If you would like assistance, please create a Minimal, Complete, and Verifiable Example
 
5:04 PM
very strange
if (!selectedCategory) {
  return;
}
const url = selectedCategory.link;
for some reason, selectedCategory has length 0
empty array
maybe because of that is skipped
because when I change to
    if (!selectedCategory.link) {
      return;
    }
when works fine
 
5:30 PM
@JBis tanks for the better advise on media query
 
 
1 hour later…
user14692552
6:39 PM
Hello
 
@codingdreaming Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
user14692552
I am trying to implement particles.js into a webpage. Why when you visit the CodePen shared and created in the top right of the home page (vincentgarreau.com/particles.js) it works completely fine. But when I create my own fiddle, it tells me particlesJS is undefined, but it is defined
 
7:32 PM
are you sure
 
user14692552
7:54 PM
Yes. Only article I could find in relation was saying ensure that you have particles.js script is initialized before anything else and I double checked it, even included the particles.min.js script as well. I will share the JSFiddle
 
i mean
ifit's undefined, it's undefined
there's no other reason it would tell you it's undefined
If you provide the fiddle i can take a look
 
user14692552
 
check the errors in the console
most notably the blocked insecure requests
on https pages, resources should be loaded over https
 
user14692552
That's my bad. I was only paying attention to the fiddle console like an idiot.
 
Ah, my monitor is too small to comfortably use that console
 
8:08 PM
pleb
come on Kevin, get a 4k'er
 
user14692552
mong
 
user14692552
I dont even think its the monitor size that matters, the platform itself is eh
 
i prefer to have a smaller monitor for general browsing so that i keep smaller browser size in mind when developing
 
Whatever lets you sleep at night ;)
Kevin, what does your company do for CI/CD? specifically CD.
 
posted on December 02, 2020 by Lakshmana Pamarthy

The Stable channel has been updated to 87.0.4280.88 for Windows, Mac and Linux which will roll out over the coming days/weeks. A full list of changes in this build is available in the log. Interested in switching release channels?  Find out how here. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn a

 
8:28 PM
whats the most efficient way to delete all files and folders in a directory except and array of paths to files and folders? for example ["file", "dir/file", "dir/dir"]. Delete all but those.
 
9:11 PM
select all, (unselect exceptions,) delete
 
9:28 PM
hey guys, in ReactJS I've seen several times in tutorials they return a component that that has empty brackets like this

    return (
        <>

        </>
    )
why do they do this and why not use a div instead?
 
div creates an extra element <> doesn't
 
ok thanks, however I assume you can't use this on the very top level component?or is that automatically inside body anyway so it doesn't matter?
 
doens't matter
 

« first day (3700 days earlier)      last day (1231 days later) »