Source map line in jsoneditor.min.js makes collectstatic fail
See original GitHub issue- django-json-widget version: 1.1.1
- Django version: 4.0
- Python version: 3.8.10
- Operating System: linux ubuntu (in docker)
Description
When running python manage.py collectstatic
with whitenoise 5.3.0, I get the following error:
es/management/commands/collectstatic.py", line 134, in collect
remote: raise processed
remote: whitenoise.storage.MissingFileError: The file 'dist/jsoneditor.map' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f260dc431f0>.
remote: The JS file 'dist/jsoneditor.min.js' references a file which could not be found:
remote: dist/jsoneditor.map
it seems it’s because of the source map bit. When we removed the last line https://github.com/jmrivas86/django-json-widget/blob/master/django_json_widget/static/dist/jsoneditor.min.js#L46 , it works.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:11
- Comments:9
Top Results From Across the Web
Can't collect static files if don't have vendor's JavaScript ...
Even if you left the source map line in, the browser devtools will request it and hit a 404, and show you an...
Read more >Unable to run collectstatic , "references a file which could not ...
js is in virtualenv. The problem is the cloudinary package apparently doesn't ship the .map file cloudinary\static\js\load-image.all.min.
Read more >django-json-widget 1.1.1 - PythonFix.com
Django json widget is an alternative widget that makes it easy to edit the jsonfield field ... Source map line in jsoneditor.min.js makes...
Read more >How to Set Up Source Maps with Django - Adam Johnson
Source maps are files that map your minified CSS or JavaScript back to the original code. They allow you to use your browser's...
Read more >Simple index - piwheels
... py-pdf-collate make-subtitle django-simple-markdown kubes ncbidare stargen xendit moneyflowindicator life-line-chart aliyun-python-sdk-schedulerx2 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s so terrible, I love it.
Here’s a one-liner to do the same thing.
This accounts for different package installation paths and whatnot…I use it in CI/CD environment.
Really someone needs to submit a PR to fix this. However, @jmrivas86 hasn’t been active on GH in many months and his website doesn’t work, so not sure if we can expect a PR to get merged. Failing that someone will have to fork…
I actually found a way to deal with this issue, if anyone ever comes here again. He asks for a file which he does not use, so I decided to just put the file where he expects it and it worked like a charm. I am building my project with a Dockerfile, so I just added there
the file may be empty. It is not the prettiest solution, but it does work. Hope it helps someone else.