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

254
Views
Parcel load typescript package into a html file (CANT IMPORT)

So I have wasted like 6 hours on this.

I need to load a typescript file with a few dependancies into a vanilla js project.

This is what I do.

  1. install all dependancies in the typescript project.
  2. yarn parcel "filepath"
  3. project compiles succesfully into dist folder
  4. move the compiled file (index.js, the only other file is index.js.map) into the vanilla js project.
  5. [The issue] Try to import the parcel file into my vanilla js project. here is what i tried.
import {myFunction} from '/index.js'; //crashes site
import myFunction from '/index.js'; //crashes site
import * from '/index.js'; //symbol not found

import * as things from '/index.js'; 
//console.log(things) prints: Module {Symbol(Symbol.toStringTag): 'Module'} Symbol(Symbol.toStringTag): "Module"

import("./index.js").then(function (myFunction) {
 console.log(myFunction);
});
//prints: Module {Symbol(Symbol.toStringTag): 'Module'} Symbol(Symbol.toStringTag): "Module"

I also have tried export default in the typescript with all the attempts above.

I appreciate any advice.

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!