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

131
Views
Simple js function not defined in view despite file compiled and referenced

I am trying to use a simple js function in a view and it doesn't seem the view is seeing the script I am referencing.

testFile.js:

export const simpleFc = (input) => {
    alert(input);
}

It build without error and I can see the resulted build js file and it's content is correct. I have no other js error in console.

I am including it in the view:

<script src="~/dist/js/testFile.build.js"></script>

Then I am trying to use it:

<script type="text/javascript">
    simpleFc('show alert');
</script>

I am getting an error saying: simpleFc is not defined.

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!