🐛parcel lays a brick when trying to build with error: "template is not a function"
See original GitHub issueindex.html:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<script src="./index.tsx"></script>
</body>
</html>
index.tsx contains proprietary code that compiles and runs fine with webpack.
Relevant error message in totality (with index.html directory stripped just because):
index.html: template is not a function
at Object.<anonymous> (C:\Users\Oliver\AppData\Local\Yarn\config\global\node_modules\parcel-bundler\src\visitors\dependencies.js:7:25)
at Module._compile (C:\Users\Oliver\AppData\Local\Yarn\config\global\node_modules\v8-compile-cache\v8-compile-cache.js:178:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (C:\Users\Oliver\AppData\Local\Yarn\config\global\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at Object.<anonymous> (C:\Users\Oliver\AppData\Local\Yarn\config\global\node_modules\parcel-bundler\src\assets\JSAsset.js:4:29)
at Module._compile (C:\Users\Oliver\AppData\Local\Yarn\config\global\node_modules\v8-compile-cache\v8-compile-cache.js:178:30)
Software | Version(s) |
---|---|
Parcel | 1.4.1 |
Node | 8.9.4 |
npm/Yarn | yarn 1.3.2 |
Operating System | Windows 10 |
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Error when invoking a dataflow flex template from a Python ...
Hmm, looks like there is a separate endpoint/call for running flex templates: docs. This worked for me: dataflow = build('dataflow', 'v1b3', ...
Read more >Distance Education for Teacher Training: Modes, Models, and ...
The often overlooked bottom line in distance education is not the policy ... Widgets are gaining increasing attention as a stand-alone multimedia tool...
Read more >Ticket: # 705801 - unsolicited email advertising Description
When I try to unsubscribe, the verification code that I type in is rejected. I believe this is a scam and a way...
Read more >Public Assistance Program and Policy Guide V3.1 - FEMA
FEMA will evaluate such requests based on damage and costs not covered under the ... FEMA refers to these components as the building...
Read more >Lots of Ways to Use Math.random() in JavaScript - CSS-Tricks
Math.random() is an API in JavaScript. It is a function that gives you a random number. The number returned will be between 0...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@DeMoorJasper ,
--no-source-maps
does eliminate the error I was getting. Unfortunately now, it saysBuilding random-file.js
for about 40 files and then it begins to hang with no further output/work.Fixed on my machine by adding
babel-template
andbabel-types
to parcel’spackage.json
. Not sure if this is indicative of some other larger issue, but submitted a PR that can be reviewed as far as that goes. For a temporary fix, you can try just editing your local copy like I did.