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.

Cannot start nuxt: Named export 'ESBuildMinifyPlugin' not found

See original GitHub issue

Environment

  • Operating System: Linux
  • Node Version: v16.13.0
  • Nuxt Version: 3.0.0-27319101.3e82f0f
  • Package Manager: yarn@1.22.15
  • Bundler: Webpack
  • User Config: vite
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. npx nuxi init nuxt3-app
  2. cd nuxt3-app
  3. yarn install
  4. Add vite: false to nuxt.config.js
  5. yarn dev

Describe the bug

ERROR  Cannot start nuxt:  Named export 'ESBuildMinifyPlugin' not found. The requested module 'esbuild-loader' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'esbuild-loader';
const { ESBuildMinifyPlugin } = pkg;


  import { ESBuildMinifyPlugin } from 'esbuild-loader';
  ^^^^^^^^^^^^^^^^^^^
  SyntaxError: Named export 'ESBuildMinifyPlugin' not found. The requested module 'esbuild-loader' is a CommonJS module, which may not support all module.exports as named exports.
  CommonJS modules can always be imported via the default export, for example using:
  
  import pkg from 'esbuild-loader';
  const { ESBuildMinifyPlugin } = pkg;
  
  at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
  at async ModuleJob.run (node:internal/modules/esm/module_job:181:5)
  at async Promise.all (index 0)
  at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
  at async bundle (node_modules/nuxt3/dist/index.mjs:1156:31)
  at async build (node_modules/nuxt3/dist/index.mjs:1132:3)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:6719:9)
  at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6756:5)
  at async _main (node_modules/nuxi/dist/chunks/index.mjs:382:7)

Additional context

No response

Logs

No response

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
danielroecommented, Dec 13, 2021

For now, you can workaround this by pinning esbuild-loader to the previous minor version. For example, with yarn:

  "resolutions": {
    "esbuild-loader": "2.16.0"
  }
0reactions
wangjing013commented, Dec 20, 2021

same issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Issues - Nuxt Vite
does not provide an export named 'default'. Vite has an issue for pre-bundling dependencies with named exports (#56 ). Workaround is to exlude ......
Read more >
API - esbuild
This API call is used by the command-line interface if no input files are provided and the --bundle flag is not present. In...
Read more >
Nuxt export 'default' (imported as 'mod') was not found
You will need atleast an empty export default script in your vue files to not see this error. If you don't have any...
Read more >
Make your Nuxt.js webpack builds faster - BestofVue
While you won't be able to achieve instant app starts anytime soon, ... description from Nuxt2 SyntaxError: Named export 'ESBuildMinifyPlugin' not found.
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