« first day (2425 days earlier)      last day (2748 days later) » 

22:00
@DanieClawson I do magic from time to time
but I cant do fireballs... yet
sighs
you really @ me for that?
XD
i found an xss vulnerability in a dashboard that a 3rd party gave us access to today.
@KevinB uh oh
you should put a message on the dashboard
explaining the bug
makes me feel so good about putting their code on our site
22:03
will just make them solve it faster
@DanieClawson I've used it
Also, if anyone would be interested in helping me:
0
A: Correctly bundled image could not be loaded

Chase DeAndaWell, I can't see your webpack config, but I'm assuming your using all the correct loaders (file-loader, extract-loader, html-loader, url-loader)? The way I handle it is using the webpack-copy-plugin to copy over my images folder so relative paths still work.

... why, are you loading an image in from the filesystem,?
@phenomnomnominal is there any way to use it without intermediate files?
@KevinB im absolutely new to web dev / react. I figured that packing it in webpack is the way to go?
22:06
eh, i dunno about that, but loading anything from the filesystem in webdev is pretty much a mistake
even in dev testing, you should have it running on at least a local webserver
Could you point me to a correct approach?
import Image from './images/image.png';

<img src={Image} />
or something like that
tried
but
webpack wont let me do that
@DanieClawson not exactly sure what you mean?
@KamilSolecki why not?
22:08
@rlemon sec, im just doing it to get the error
what does your webpack config look like.
put that in a gist or something
@phenomnomnominal well rather than generating .transpiled.js, .concat.js, .min.js, i just do it all by passing source strings and map objects along right now
but sorcery looks like it only works if all those files are actually existing on the fs
try with file loader for images.
22:12
@DanieClawson yeah I've only ever used it with existing files
i guess there's nothing really wrong with that and i should just rewrite my end around doing it that way
idk
It works from the sourcemap
and goes up the whole chain to your original source
for(var i = 0; i < Ground.length; i++) {
   if(Ground[i].isCollided(Player)) {
      Player.dy = 0;
      Gravity = 0;
      break;
   }
}
@rlemon with either loader, im getting illegal import declaration error
this will break the loop after the first if matches right?
22:15
@KamilSolecki since some parts work, check your output.path (webpack) and compare that to the WORKING parts of the bundle (.js). Then you''l be able to test the image path by simply putting that url into the broser address bar manually and see it
@KamilSolecki for all import statements or just the import statement for the image
what's the real error?
@rlemon everywhere else I use require. This is the ONLY import statement
then use require().
then you need that transform/plugin/whatever or use ^
22:16
ERROR in ./components/Login.jsx
Module build failed: Error: Parse Error: Line 1: Illegal import declaration
    at throwError (C:\Users\Kamilczak\Documents\Visual Studio 2017\Projects\NoCo
ntrol\NoControl\node_modules\jstransform\node_modules\esprima-fb\esprima.js:2823
:21)
    at throwErrorTolerant (C:\Users\Kamilczak\Documents\Visual Studio 2017\Proje
cts\NoControl\NoControl\node_modules\jstransform\node_modules\esprima-fb\esprima
.js:2835:24)
    at parseSourceElement (C:\Users\Kamilczak\Documents\Visual Studio 2017\Proje
Error
sounds like it just isn't conifured for es6 imports.
@Luggage I did, which led me to this: stackoverflow.com/questions/44398432/…
a file path? like with a drive letter?
that can't be right
@SterlingArcher babel and ES6 come with react.net
22:18
@SterlingArcher Sorry, feel free to downvote. It's just that, it's a little odd to be developing games with javascript if you don't know what a loop is. — Shiva 1 min ago
Which im using
How do you even respond to this?
then it would be transforming the import to a require
It's so condescending.
@KamilSolecki you probably need a transform for import syntax
22:18
@MadaraUchiha ^
@SterlingArcher ignore. they aren't worth the effort
or, just use require
like luggage said
well at least TEST with require()
But somebody is wrong on the internet
@Luggage well, I'd assume if he used it and it didn't work we'd hear about it 😉
22:19
Separate the two problems of import syntax and webpack iamge bundling
!!giphy you assume too much
@Luggage please read my SO question that I linked you - I had tried it and what happens after that is linked there
with pictures
bah, giphy
I looked at your issue which is where I saw a local pathname.
I am asking a question about your question
my main issue is that my image did not load into the site.
I know.
22:21
While that might be true, there's no room for snark in Stack Overflow answers. Stay informative and professional. Also, today's JS devs don't use for loops like that to iterate arrays, we use for..of. — Madara Uchiha ♦ 18 secs ago
Just a tiny bit of snark on my own :)
so, please tell me again what exactly do you need to know, and I will try to provide @Luggage
Well played sir, added my 2 cents
do you use a webserver?
if so a path starting with C:\ is NOT correct.
wait, what?
22:22
react.net outputting static html files you're running locally?
from like file:///
lol and they voted to close as dupe
classic mainoob
i thought you were using asp.net..
@MadaraUchiha he updated to for of, but kept the var
give me the url of the main page. the index.html
i am. I have pretty much no back end yet tho. Except for my single controller and view
22:24
lol
@Luggage gonna be a thin minty night I think
Could someone please post a competing, competent answer?
No it's a dupe
Stop saying that. I told you. I'm on break :(
Mark it as such then?
Stop forcing us to break the rules, mod.
22:25
oh wait wait wait
did you mean IIS? @Luggage
my bad, "I'm on a thin mint break" could be interpreted two ways.
I took it the other way
and/or the one in visual studio
jsut give me what is in your address bar of the browser
@rlemon :)
i've been pretty regular for a while, so decided i should take some time off.
I'm trying that with alcohol. but failing. having a beer right now.
but this will likely be my only beer of the night.
22:27
ok, so, c:\ at the beginning of an image url is not right. Go back to that point in your debugging
also, please answer the question i was trying to get you to answer the other day
the return value of require('./some/image.jpg')
publicPath: path.join(__dirname, 'Built/'),
this is the problem.
public path is a URL, not a file path. drop the __dirname
it should be like "/" or "/myapp"
^ @Luggage irl
the __dirname thing is proper most other places, though, as they are local file paths, not a public url
if only my ears were that small.
grow a bigger head. they'll shrink in comparison
First, as to your question about require - its different from what it used to be, as currently i managed to make it work. My current require output is the image's location: C:\Users\Kamilczak\Documents\Visual Studio 2017\Projects\NoControl\NoControl\Built\c0100f9d1d3839f5da1ee148f4dcb66e.jpg
yea, the line after that is where i found a real problem
and the explanation for that answer.
outputPath: "/"
most likely.
22:32
hehe, I knew he was going to regret woodchips when I saw the first one
source: I've tried it :P
btw, if you showed me the output of require() the other day and I saw "C:\" in it, i'd know right away.
for anyone looking into aquaponics, clay/gravel/rubber mulch mix seems to work out very well. clay and gravel for the water bed, and rubber mulch to cover the plant systems/add support. #nowYouKnow
    output: {
        path: path.resolve(__dirname, 'public'),
        filename: 'app.js'
    },
@KamilSolecki that's what my output config looks like
I'm onto a specific problem, please give me a minute before going another direction.
@SterlingArcher back off, get your own noob.
;)
22:37
I already have the next question queued up if this doesn't fix it, but @KamilSolecki is taking forever
the plants are kinda leaning
I think I need to add a track to move the lights for the alpha build.
this beta system is good enough (tm)
@Luggage Im trying to find out where the hell did webpack build the files, as I need to put them in my view :D
no.
just change that ONE line and try again, please
@rlemon jokes on you I didn't use yours!
22:39
if you go chaning other things it just confuses things
@rlemon i was using scoria and it didn't work so good, but i think there were many many things i was doing wrong
ok, then what was the result?
You just helped me adjust the one I took :P
the result is nothing changed. My uneducated guess is that apart from this: @Html.React("Components.Login", new {...})

in my view I have this :

<script src="@Url.Content("~/Built/client.bundle.js")"></script>

Which Im guessing currently points to the old build
@david any lavarock type of substrate should work fine. what you see there is about half gravel half aerated clay stone (tiny bit of crushed lava rock I had) then about 3 inches of rubber mulch
the water drain is level with the stones, so they always stay wet
22:41
Nothing changed? it still has c:\ in the path after changing to publicPath: '/' ?
the rubber sits on top
At least that is the setup that was provided on the React.net webpack page
the roots just touch the gravel. so they can expand as they like. I don't force them to be wet
seems to be working out so far.
Is it appropriate to just chain .parentElement or is there a better way to find an element in relation to a clicked node?
developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/… how come the XMLHttpRequest properties don't use camelCase?
22:42
C:\Users\Kamilczak\Documents\Visual Studio 2017\Projects\NoControl\NoControl\Built\c0100f9d1d3839f5da1ee148f4dcb66e.jpg
still
@Kramb what's the scenario
sounds like a good use of event delegation
my current webpack for output
did you save webpack config? and stop/restart a dev-server if you have one?
output: {
        path: '/',
        publicPath: '/',
        filename: '[name].bundle.js'
    },
22:43
@Luggage Yes, I did rebuild and save
why did you change the path?
are you fucking with me?
put that back to path: path.join(__dirname, 'Built/'),
@rlemon is the clay you're using the little balls i've seen online? What is the benefit of those? lots of air in them and good water retention?
no wonder you didn't see changes, tou started saving your webpack output in your root of c:\
I probably need to buy some
I have a panel that contains several fieldsets. The click event is attached to each individual fieldset and I need to get the innerText of the panels header. I can provide you with a DOM if necessary. @rlemon
22:43
12 mins ago, by Luggage
outputPath: "/"
correct
we.. sorta.
we were both wrong
I meant publicPath: '/'
but never even said path:
oke, now ill rebuild
We have progress
the image path should be more like "/Built/..."
Im getting an image placeholder icon
and the path is
/c0100f9d1d3839f5da1ee148f4dcb66e.jpg
@Kramb at least the relevant stuff would be nice.
22:46
should that include Built/
?
probably, yes. You can just try publicPath: '/Built' or check the output of <script src="@Url.Content("~/Built/client.bundle.js")"></script> (the version in the browser) to see what it says
YES
you are the best
(probably just /Built/client.bundle.js but can include more if you change the root)
works
@Luggage is the best guys. @rlemon is also a cool human.
22:48
if you ever change the location of your site (like start hosting it at /myApp instead of /) then you change publicPath to match.
note, this is what "~" means in ASP.NET
the public path.
Damn, tbh I recall trying just /
probably something else was f-ed up
that's often fine, but using ~/ makes it so that app can be hosted at a configurable url.
(in .net, like you already do)
Awesome. Thanks again for halp.
much much appreciated
22:50
@Kramb and so when you click anywhere in the panel you want to log the panel title?
@rlemon Yea, the click eventListener is attached to each fieldset
why?
like, what do you need from that event
When I click the fieldset, I get the Unit. The Unit will be designated by a number. Sorry, that's not reflected in the example. I was trying to hurry.
storing a bunch of the data in the dom is frowned upon. makes these things harder than it needs to be
Where it says Unit, it will really say 101/102/103
22:57
whereas I still think it's the wrong approach... something like this maybe
    const title = panel.querySelector('.panel-title');
    panel.querySelectorAll('fieldset').forEach(fieldset => {
	    fieldset.addEventListener('click', handler.bind(fieldset, title))
    })
then the handler would be like
function handler(title, event) {
  // 'this' is the fieldset element
}
so you have all relevant data, I think
"…because there are 999 'undefined' in there". No, there aren't. There are two members and a length of 1001. — RobG 3 mins ago
seriously are we not doing phrasing anymore

« first day (2425 days earlier)      last day (2748 days later) »