question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v1.12.4 fails with "api.caller is not a function" when bundling an HTML file with a <style> tag

See original GitHub issue

🐛 bug report

parcel v1.12.4 fails with “api.caller is not a function” when bundling an HTML file with a <style> tag.

🎛 Configuration (.babelrc, package.json, cli command)

package.json:

{
  "name": "parcel",
  "version": "1.0.0",
  "description": "",
  "main": "index.html",
  "scripts": {
    "start": "parcel index.html --open"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "parcel-bundler": "^1.12.4"
  }
}

No other files except for index.html (see below). Running parcel by npm start.

🤔 Expected Behavior

I should see a page in my browser.

😯 Current Behavior

Server fails with error message:

Server running at http://localhost:1234
🚨  /path_to_my_repo/node_modules/parcel-bundler/src/builtins/css-loader.js: api.caller is not a function
    at /path_to_my_repo/node_modules/@babel/preset-env/lib/index.js:237:35
    at Object.default (/path_to_my_repo/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12)
    at getEnvPlugins (/path_to_my_repo/node_modules/parcel-bundler/src/transforms/babel/env.js:62:34)
    at getEnvConfig (/path_to_my_repo/node_modules/parcel-bundler/src/transforms/babel/env.js:12:25)
    at async getBabelConfig (/path_to_my_repo/node_modules/parcel-bundler/src/transforms/babel/config.js:32:19)
    at async babelTransform (/path_to_my_repo/node_modules/parcel-bundler/src/transforms/babel/transform.js:6:16)
    at async JSAsset.pretransform (/path_to_my_repo/node_modules/parcel-bundler/src/assets/JSAsset.js:83:5)
    at async JSAsset.process (/path_to_my_repo/node_modules/parcel-bundler/src/Asset.js:214:7)
    at async Pipeline.processAsset (/path_to_my_repo/node_modules/parcel-bundler/src/Pipeline.js:46:7)
    at async Pipeline.process (/path_to_my_repo/node_modules/parcel-bundler/src/Pipeline.js:24:23)

💁 Possible Solution

Removing the <style> tag fixes the problem.

💻 Code Sample

index.html:

<!DOCTYPE html>
<html lang="en">
  <head>
    <style type="text/css">
      h1 {
        color: red;
      }
    </style>
  </head>

  <body>
    <h1>Parcel</h1>
  </body>
</html>

🌍 Your Environment

Software Version(s)
Parcel 1.12.4
Node 12.8.1
npm/Yarn npm 6.11.3
Operating System MacOS 10.14.6 (18G1012)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
n1313commented, Nov 5, 2019

@mischnic removing node_modules and reinstalling to get @babel/preset-env@7.7.1 installed fixed the problem. Thanks!

0reactions
n1313commented, Nov 5, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript error: "is not a function" - Stack Overflow
It was attempted to call a value like a function, but the value is not actually a function. Some code expects you to...
Read more >
Node.js v19.3.0 Documentation
Iterates through the list of functions passed to tracker.calls() and will throw an error for functions that have not been called the expected...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
systemPrefs with at least two files" status:RESOLVED resolution:OBSOLETE severity: ... Bug:115285 - "tpop3d crashes with "stack smashing attack in function ...
Read more >
Xcode 14 Release Notes | Apple Developer Documentation
Workaround: Restart the machine. When running in macOS 13 beta, AppIntents code may fail to build with Xcode 14. (99661742) (FB11470314). Workaround: Build ......
Read more >
C++ Core Guidelines - GitHub Pages
This document is a set of guidelines for using C++ well. ... to tag a function noexcept , especially because of the issue...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found