Stack Exchange
log in
users (10)
rooms (16)
faq
Develoger
general
recent
conversations
JavaScript
Topic: Anything JavaScript, ECMAScript including Node, React, ...
4
Develoger
Feb 6, 2018 09:15
anyone tried to make SSR + AsyncComponent work, outside of Routes? I mean using AsyncCmp in another cmps...
Develoger
Jan 31, 2018 14:08
And if it goes into index.js for some reason it imports some other cmps as well
Develoger
Jan 31, 2018 14:07
if I use relative path '../Icon'; Jest works
Develoger
Jan 31, 2018 14:07
in Avatar.js which I want to test I import Icon like this. import { Icon } from 'components';
Develoger
Jan 31, 2018 14:06
Develoger
Jan 31, 2018 14:06
Anyone have an idea why would Jest make such stack trace?
Develoger
Jan 29, 2018 20:47
damn I did not knew the rules!
Develoger
Jan 29, 2018 20:47
thanks
Develoger
Jan 29, 2018 20:47
:D
Develoger
Jan 29, 2018 20:46
omg try and catch
Develoger
Jan 29, 2018 20:45
await foo().catch(error => console.log(error)); ?
Develoger
Jan 29, 2018 20:44
am using some async functions, but no promises...
Develoger
Jan 29, 2018 20:43
anyone have a clue?
Develoger
Jan 29, 2018 20:43
I have react ssr / webpack...
Develoger
Jan 29, 2018 20:43
Develoger
Jan 26, 2018 21:07
thanks
Develoger
Jan 26, 2018 21:07
shit no
Develoger
Jan 26, 2018 21:07
"http://localhost:8080/embed/1.bundle.js"
Develoger
Jan 26, 2018 21:07
Webpack chunks issue:
GET http://localhost:8080/embed/1.bundle.js net::ERR_ABORTED
Chunk tried to be loaded from relative path (relative to the current url) instead of loading it from the root. So after :8080/1.bundle.js...
Develoger
Jan 26, 2018 19:35
React - SSR and chunks. I load base bundle but client code does not get initiated for some reason. It worked before I introduced chunks. Now chunks work in dev but not on SSR. Any idea, based on this shitty description?
Develoger
Jan 25, 2018 15:43
within the React + Webpack env
Develoger
Jan 25, 2018 15:43
in async method
Develoger
Jan 25, 2018 15:43
const Component = await import(
../embeds/${cmpId}
);
Develoger
Jan 25, 2018 15:43
so this would work
Develoger
Jan 25, 2018 15:42
Do anyone knows if import() supports dynamic paths?
Develoger
Jan 25, 2018 15:41
it is what caused the funky behavior...
Develoger
Jan 25, 2018 15:41
@Mosho I had this
const Component = require(`../embeds/${cmpId}`)[cmpId];
Develoger
Jan 25, 2018 14:57
but it is nice to say thanks
Develoger
Jan 25, 2018 14:57
@Mosho I still did not solved sadly
Develoger
Jan 25, 2018 14:51
thanks guys!
Develoger
Jan 25, 2018 14:51
@Mosho you are right
Develoger
Jan 25, 2018 14:45
even if there is reference to this enzyme resource
Develoger
Jan 25, 2018 14:45
am not sure why it bundles spanshot @Mosho
Develoger
Jan 25, 2018 14:43
since there is one file for testing which imports enzyme
Develoger
Jan 25, 2018 14:43
but don't have clue how to solve
Develoger
Jan 25, 2018 14:42
I know where sadly
Develoger
Jan 25, 2018 14:42
yeah
Develoger
Jan 25, 2018 14:42
which makes bundle huge
Develoger
Jan 25, 2018 14:42
and if I remove the externals property from webpack config it builds enzyme as well :D
Develoger
Jan 25, 2018 14:41
spent a day debugging that
Develoger
Jan 25, 2018 14:40
yeah I am so pissed atm tbh
Develoger
Jan 25, 2018 14:40
yeah
Develoger
Jan 25, 2018 14:39
my bundle is 493 bytes then :D
Develoger
Jan 25, 2018 14:38
just a sec
Develoger
Jan 25, 2018 14:38
I have no reference to the tests in import
Develoger
Jan 25, 2018 14:37
exactly
Develoger
Jan 25, 2018 14:35
this is for web app
Develoger
Jan 25, 2018 14:35
even in the production bundles?
Develoger
Jan 25, 2018 14:34
You suggest to try with common chunks?
Develoger
Jan 25, 2018 14:34
thanks for saying that. Am a bit confused, why would test even be in any bundle