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

522
Views
Angular 13 - Support for the experimental syntax 'importMeta' isn't currently enabled

After upgrading to angular 13 I'm having this issue. I am trying to create a worker like this:

new Worker(new URL('../path/to/worker', import.meta.url), {type: 'module'})

This works fine when I do "ng serve" or "ng build". However, it does not work when I run "ng build --configuration production". If I turn buildOptimizer and aot to false it does work but that's something I'm trying to avoid.

It looks like this has everything to to with the import.meta.url. It doesn't make much sense since this is an established standard.

So, when I run "ng build --configuration production" It throws the error:

Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):

SyntaxError: Support for the experimental syntax 'importMeta' isn't currently enabled (18:102):

Add @babel/plugin-syntax-import-meta (https://git.io/vbKK6) to the 'plugins' section of your Babel config to enable parsing.

This is weird since I'm not using babel, at least directly. Maybe it's Angular's buildOptimizer that uses babel, but if it is, I cannot change it's configs.

Is there any fix or workaround to this issue?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I had the same issue after upgrading to Angular 12 from 9. I managed to fix the issue by removing the node_modules folder and the package-lock.json file and running npm install.

There must have been some conflicting packages or something but doing the above fixed it.

about 4 years ago · Juan Pablo Isaza Report
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!