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.

TypeError: esbuild is not a function

See original GitHub issue

When using the latest rollup version and latest rollup-plugin-esbuild version, I get the following error when running rollup: TypeError: esbuild is not a function

my rollup config looks like this:

import json from "@rollup/plugin-json";
import dts from "rollup-plugin-dts";
import esbuild from "rollup-plugin-esbuild";

import pkg from "./package.json";

export default [
  {
    input: "src/lib/index.ts",
    plugins: [
      esbuild({
        // All options are optional
        include: "src/lib/",
        minify: process.env.NODE_ENV === "production",
        tsconfig: "tsconfig.lib.json",
      }),
      json(),
    ],
    output: [
      { file: pkg.main, format: "cjs" },
      { file: pkg.module, format: "es" },
    ],
  },
  {
    input: "src/lib/index.ts",
    output: [{ file: pkg.types, format: "es" }],
    plugins: [dts()],
  },
];

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
matteosacchettocommented, Dec 1, 2022

https://stackblitz.com/edit/node-gcuwxg?file=rollup.config.mjs I did some fixes to your project (some missing deps + some chores) Now it seems to work without issues.

Let me know if you have any question 😃

0reactions
sishen654commented, Dec 8, 2022

Modified the packaging command build, and introduced the imported package.json through other methods😁😁😁There is even a way to create require, learned✨

Read more comments on GitHub >

github_iconTop Results From Across the Web

Copy plugin for esbuild "is not a function" - Stack Overflow
The problem was, that the DOM contained another element named copy that was not a function. Even though I'm not in a Browser...
Read more >
esbuild is not a function · Issue #23 · unjs/unbuild - GitHub
If you generate a new repository using unbuild, and some parts of your build relies on rollup, you get a TypeError breaking the...
Read more >
FAQ - ESBuild
While esbuild is busy parsing your JavaScript, node is busy parsing your bundler's JavaScript. By the time node has finished parsing your bundler's...
Read more >
Uncaught TypeError: util.inherits is not a function
Uncaught TypeError: util.inherits is not a function · npm install --save-dev @esbuild-plugins/node-globals-polyfill · npm install --save-dev @ ...
Read more >
rollup-plugin-esbuild - npm
You can help the author become a full-time open-source maintainer by [sponsoring him on GitHub](https://github.com/sponsors/egoist).**.
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