Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
Error connecting Vue.js components via CDN

I write a simple blog. I made the public part in PHP + JS, I want to write the admin panel in PHP + Vue.js

Connecting via CDN is not difficult, but how do you connect components after that? At normal connection gives an error.

Cannot use import statement outside a module

If you write type="module", then

Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.

Apparently, there must be another way. I struggle for a long time, I can not find answers on the Internet.

Files now
ADMIN
 |__ admin.php
 |__ main.js
 |
 |__ components
      |__ App.vue

// main.js
const app = Vue.createApp({
    data() {
        return {
            test: 11,
        }
    },
});

app.mount('#app');
<!-- admin.php -->
<!doctype html>
<html lang="ru">
<head>
    <title>ADMIN PANEL</title>
    <script src="https://unpkg.com/vue@3"></script>
</head>
<body>
    <div id="app">
        {{ test}}
    </div>
</body>
</html>

<script src="/views/admin/main.js" type="module" ></script>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!