Skip to content
loading...

re: Django + webpack + Vue.js: setting up a new project that’s easy to develop and deploy (part 1) VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi Alejandro, I wanted to thank you for your post, it was indeed very useful. When running in production I get this error: "webpackJsonp is not d...
 

Usually whenever I got that, it's because you are using multiple bundles/chunks that might not be imported in the correct order.

 

Hey Vlad,

yes, that's exactly the solution. In my case I ended up creating a context_processor called env, like this:

from django.conf import settings

def env(request):
    return {'env': settings.ENVIRONMENT}

That allows me to check agains the environment instead of DEBUG in my templates, ie:

{% if env == 'production' %}
  {% render_bundle 'manifest' %}
  {% render_bundle 'vendor' %}
{% endif %}
{% render_bundle 'app' %}

I'll treat this and a few more issue in the second part :)

code of conduct - report abuse