Skip to content

isWindow not found #175

@adityar15

Description

@adityar15

Environment

Nuxt CLI v3.0.0-27287661.1e0e881 23:09:16
RootDir: L:\adirani\app 23:09:17
Nuxt project info: 23:09:17


  • Operating System: Windows_NT
  • Node Version: v16.13.0
  • Nuxt Version: 2.16.0-27286577.ab1c6cb4
  • Package Manager: npm@8.1.0
  • Bundler: Webpack
  • User Config: target, head, css, plugins, components, buildModules, generate, modules, axios, pwa, build, serverMiddleware, env
  • Runtime Modules: @nuxtjs/axios@5.13.6, @nuxtjs/pwa@3.3.5
  • Build Modules: @nuxtjs/tailwindcss@4.2.1, @nuxt/bridge@3.0.0-27287661.1e0e881

👉 Report an issue: https://github.com/nuxt/framework/issues/new 23:09:17

👉 Suggest an improvement: https://github.com/nuxt/framework/discussions/new

👉 Read documentation: https://v3.nuxtjs.org

Reproduction

When I run

npm run build

Describe the bug

After running npm run build got the following error

 FATAL  [worker] Named export 'isWindows' not found. The requested module 'std-env' 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 'std-env';
const { provider, isWindows } = pkg;


  import { provider, isWindows } from 'std-env';
  ^^^^^^^^^
  SyntaxError: Named export 'isWindows' not found. The requested module 'std-env' 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 'std-env';
  const { provider, isWindows } = 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 loadESM (node:internal/process/esm_loader:88:5)
  at async handleMainPromise (node:internal/modules/run_main:65:12)


   ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮
   │                                                                                                   │
   │   ✖ Nuxt Fatal Error                                                                              │
   │                                                                                                   │
   │   SyntaxError: [worker] Named export 'isWindows' not found. The requested module 'std-env' 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 'std-env';                                                                      │
   │   const { provider, isWindows } = pkg;                                                            │
   │                                                                                                   │
   │                                                                                                   │
   ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯


 ERROR  Command failed with exit code 1: npx nuxt generate                                                    23:03:02

  at makeError$1 (/L:/adirani/app/node_modules/nuxi/dist/chunks/generate.mjs:1083:11)
  at handlePromise (/L:/adirani/app/node_modules/nuxi/dist/chunks/generate.mjs:1772:26)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async Object.invoke (/L:/adirani/app/node_modules/nuxi/dist/chunks/generate.mjs:1942:7)
  at async _main (/L:/adirani/app/node_modules/nuxi/dist/chunks/index.mjs:386:7)

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions