django-compressor-parceljs icon indicating copy to clipboard operation
django-compressor-parceljs copied to clipboard

Getting Error When Using with Typescript

Open rjbullock opened this issue 3 years ago • 2 comments

I believe I have everything installed and configured correctly.

STATICFILES_FINDERS = [ "django.contrib.staticfiles.finders.FileSystemFinder", "django.contrib.staticfiles.finders.AppDirectoriesFinder", "compressor.finders.CompressorFinder", ]

COMPRESS_ENABLED = True

COMPRESS_REBUILD_TIMEOUT = 2592000  # (30 days in seconds)
COMPRESS_OFFLINE = False

COMPRESS_OFFLINE_TIMEOUT = 31536000  # (1 year in seconds)
COMPRESS_OUTPUT_DIR = 'dev'

And in my template:

{% block extra_js %}
    <script type="text/javascript" src="{% static 'bundle.js' %}"></script>
    {% compress parcel file myts %}
        <script src="{% static 'test.ts' %}"></script>
   {% endcompress %}
 {% endblock %}

However, when I hit the page I get the following error:

TypeError at /todo/
Signal.__init__() got an unexpected keyword argument 'providing_args'

Any idea what could be wrong?

rjbullock avatar Oct 31 '22 14:10 rjbullock

I got around this error by editing signals.py to this:

import django.dispatch
post_compress = django.dispatch.Signal()

It now works for regular JS but for TS, modules don't seem to load.

rjbullock avatar Oct 31 '22 16:10 rjbullock

@rjbullock Thanks for updating this. And I am very sorry for not replying when needed.

eadwinCode avatar Feb 27 '23 08:02 eadwinCode