Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing .map files causing collectstatic to fail using current master branch (TinyMCE 6) #460

Closed
philgyford opened this issue Mar 14, 2024 · 5 comments · Fixed by #461
Closed

Comments

@philgyford
Copy link

I tried out the current, unreleased, version of master f04e1c8 that includes TinyMCE v6, thanks to #426:

pipenv install -e git+https://github.com/jazzband/django-tinymce.git@master#egg=django-tinymce

It seemed to work fine with an initial test locally, but when I tried running manage.py collectstatic I got this error:

Post-processing 'tinymce/skins/ui/oxide-dark/content.inline.js' failed!

Traceback (most recent call last):
  File "manage.py", line 24, in <module>
    main()
  File "manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/root/.local/share/virtualenvs/code-_Py8Si6I/lib/python3.8/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/root/.local/share/virtualenvs/code-_Py8Si6I/lib/python3.8/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/root/.local/share/virtualenvs/code-_Py8Si6I/lib/python3.8/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/root/.local/share/virtualenvs/code-_Py8Si6I/lib/python3.8/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/root/.local/share/virtualenvs/code-_Py8Si6I/lib/python3.8/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
    collected = self.collect()
  File "/root/.local/share/virtualenvs/code-_Py8Si6I/lib/python3.8/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 154, in collect
    raise processed
whitenoise.storage.MissingFileError: The file 'tinymce/skins/ui/oxide-dark/content.inline.js.map' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0xffffa14393a0>.

The JS file 'tinymce/skins/ui/oxide-dark/content.inline.js' references a file which could not be found:
  tinymce/skins/ui/oxide-dark/content.inline.js.map

Please check the URL references in this JS file, particularly any
relative paths which might be pointing to the wrong location.

As you can see I'm using whitenoise, and I haven't tried it without.

I can't see any .map files in those tinymce/skins/ folders, but also can't see any in the version of TinyMCE 6 downloaded direct from the tiny.cloud website.

There are some closed issues for previous versions of TinyMCE in which they concluded that the released files shouldn't include references to .map files, e.g. tinymce/tinymce#5489 and tinymce/tinymce#4649 but can't see anything more recent. Still, maybe this is actually an issue for TinyMCE?

@claudep
Copy link
Contributor

claudep commented Mar 14, 2024

Thanks a lot for testing! Do you think we should remove the sourceMappingURL lines from the various TinyMCE source files?

@philgyford
Copy link
Author

It seems like that's the approach they took before. I could open an issue there asking if they should be doing that, seeing as that was the previous approach?

@claudep
Copy link
Contributor

claudep commented Mar 14, 2024

Sure, you can always try!

@philgyford
Copy link
Author

Here we go: tinymce/tinymce#9484

In creating that I've realised it's unrelated to Whitenoise. The error also occurs using django.contrib.staticfiles.storage.ManifestStaticFilesStorage as Django's staticfiles backend.

If that's changed to django.contrib.staticfiles.storage.StaticFilesStorage then there's no error.

@marius-mather
Copy link
Contributor

marius-mather commented Mar 24, 2024

It looks like the official word from the Django project is that this should raise an error, and you should include the .map files if possible, see https://code.djangoproject.com/ticket/33353.

Other projects have fixed this issue by just removing the sourceMappingURL lines, e.g. farridav/django-jazzmin#488. I will put up a PR to remove them here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants