django-webpack-loader icon indicating copy to clipboard operation
django-webpack-loader copied to clipboard

Get Blank page

Open axwack opened this issue 6 years ago • 15 comments

I have loaded and followed this correctly and the bundles load but I get a blank screen when using the Django server. Any ideas?

axwack avatar Apr 17 '18 13:04 axwack

Have you tried to view source of your HTML and see if the JS tabs and rendered properly? If you say bundles are loading then the issue must be with you JS code which is out of scope of this project. That said, share a stripped down, hello world version of your app here and I can try to help if I can.

owais avatar Apr 19 '18 10:04 owais

Nothing gets rendered. I even did this with one of the older tutorials. How can I send you the hello world? Do you want me to share the JS files?

axwack avatar Apr 19 '18 17:04 axwack

This is too vague. What do you mean by "nothing". Is entire HTML page empty, are the script pages missing, does your JS app not render it's UI but django sends down the HTML?

How can I send you the hello world? Do you want me to share the JS files?

Normally people create temporary repositories on github to share such code but it won't be useful if this is an issue in your JS app. From your earlier comment, it seems the bundles are loading. Django-webpack-loader's responsibility ends there. If the bundles do load, it might be an issue with your JS code.

owais avatar Apr 19 '18 18:04 owais

First, thank you for taking the time. When I mean nothing the script tags where you have {%render bundle 'main'%}, the loader finds files in my bundle directory. I took the login page from this example

https://medium.com/technoetics/create-basic-login-forms-using-create-react-app-module-in-reactjs-511b9790dede

When you run it with npm..it loads fine. When I try to load this after configuring for babel and webpack and your loader, I get a blank html page with the script tags where the render bundle is but not output from the react page.

I run this using the manage.py run server.

I thought that if you do it this way it will show up via the django web server.

I have a temporary repository here :

https://github.com/axwack/arlo_admin_app

Thank you for your time.

axwack avatar Apr 19 '18 18:04 axwack

Have you ever seen this error?

Module build failed: Error: Couldn't find preset "react-app" relative to directory "/Users/vincentlee/Documents/Development/arlo_react/frontend"

axwack avatar Apr 19 '18 19:04 axwack

Looks like "react-app" package is missing. Is this supposed to be an npm package that you install or a custom one?

owais avatar Apr 19 '18 20:04 owais

I also experienced the same problem while integrating react app (that I created with create-react-app) to my Django application. When I looked closely to my stats file I realized that my webpack-config generated 3 files: 0.chunk.js, main.bundle.js, bundle.js I solved the problem by importing all of them

emrehayirci avatar Oct 11 '18 22:10 emrehayirci

This is too vague. What do you mean by "nothing". Is entire HTML page empty, are the script pages missing, does your JS app not render it's UI but django sends down the HTML?

How can I send you the hello world? Do you want me to share the JS files?

Normally people create temporary repositories on github to share such code but it won't be useful if this is an issue in your JS app. From your earlier comment, it seems the bundles are loading. Django-webpack-loader's responsibility ends there. If the bundles do load, it might be an issue with your JS code.

I am also experiencing the same problem with webpack 4, it seems like every js files are generated successfully, but main.chunk.js are only rendering in the browser 0.chunk.js and bundle.js are missing, so its causes the blank page. I have posted the issue in the StackOverflow but no replay.

jaisonjjames avatar Nov 07 '18 05:11 jaisonjjames

@emrehayirci Did you import them manually? Doesn't that defeat the purpose of using the webpack loader?

cc: @owais

ehmadzubair avatar Nov 27 '18 11:11 ehmadzubair

@ehmadzubair Yes, for now I moved forward with importing them manually. I know it is not ideal but for now until other tasks finished this keeps me going. I am open for suggestions.

emrehayirci avatar Nov 30 '18 08:11 emrehayirci

@emrehayirci I had a workaround for this. Check #183

ehmadzubair avatar Nov 30 '18 11:11 ehmadzubair

@ehmadzubair Yes this was the same workaround I mentioned above. But I am pretty sure it is not an ideal one because we are manually adding them to the template. So what happens if we prefer to increase our number of chunks? Feels something not right here.

emrehayirci avatar Dec 05 '18 22:12 emrehayirci

Anyone solved the problem? I still cant solve it. here is my question. https://stackoverflow.com/questions/53772300/django-reactjs-no-template-being-rendered

bossajie avatar Dec 14 '18 01:12 bossajie

I am also having the same issue. I would be thankful if anyone found a proper solution for this issue!

oussjarrousse avatar Feb 05 '19 14:02 oussjarrousse

I am also having the same issue. I would be thankful if anyone found a proper solution for this issue!

Try https://github.com/owais/django-webpack-loader/issues/183#issuecomment-442057285

jaisonjjames avatar Feb 06 '19 05:02 jaisonjjames

Hard to reproduce. If anyone face this again, please open a new issue. Closing this one.

fjsj avatar Nov 29 '23 20:11 fjsj