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

441
Views
Why i'm getting this Uncaught SyntaxError: Cannot use import statement outside a module despite of installing webpack

Hi i'm getting this error

Uncaught SyntaxError: Cannot use import statement outside a module

Expection: i'm ready to use any library or npm package if it solves the just import problem , any extension file not just .vue only

despite of installing webpack "webpack": "^5.73.0"

Here is how my project structure will look like

/project_folder
  package.json
  index.js
  webpack.config.js
  components/
             HelloWorld.vue

package.json

 {
  "type": "module",
  "main": "index.js",
  "dependencies": {
    "axios": "^0.21.0",
    "vue": "^2.6.14"
  },
  "devDependencies": {
    "webpack": "^5.73.0"
  }
}

webpack.config.js

module.exports = {
    entry: './index.js',
};

index.js

 import HelloWorld from './components/HelloWorld.vue';

 console.log(HelloWorld);

Note: this type of project structure design is required for our plugin component, project structure design cannot be changed.

about 4 years ago · Santiago Gelvez
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!