Django Integration vue appears "Uncaught SyntaxError: Unexpected token <"

problem description

when trying to integrate vue with django, django was able to find the relevant static file, but reported an error "Uncaught SyntaxError: Unexpected token <" .
clipboard.png

clipboard.png
preview
clipboard.png

dist

distserve5000

clipboard.png

vue-cli 3.0vuebudildist

clipboard.png

django

clipboard.png

related codes

setting.py configuration

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": ["dist"],
        "APP_DIRS": True,
        "OPTIONS": {
            "context_processors": [
                "django.template.context_processors.debug",
                "django.template.context_processors.request",
                "django.contrib.auth.context_processors.auth",
                "django.contrib.messages.context_processors.messages",
            ],
        },
    },
]
STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "dist")
]

urls.py configuration

urlpatterns = [
    path("admin/", admin.site.urls),
    re_path(r"", TemplateView.as_view(template_name="index.html"))
]

ask the boss for help!

Oct.19,2021

check whether you returned JavaScript or JSON?. Most likely, HTML/XML was returned and could not be parsed.
did you write something like this

<script src="index.html"></script>

reference:
Uncaught SyntaxError: Unexpected token

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf3fac-3a27b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf3fac-3a27b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?