Skip to content

[@vuedx/typecheck] vite build error with const FSP = require('fs/promises'); #144

Description

@illuSioN4ng

Describe the bug
i init a projecr by vite 2.0.0-beta.4, but when i try to run yarn build, the error message is showing below:

yarn run v1.22.4
warning package.json: No license field
$ vuedx-typecheck . && vite build
internal/modules/cjs/loader.js:626
    throw err;
    ^

Error: Cannot find module 'fs/promises'
Require stack:
- E:\workspace\summary-report\node_modules\@vuedx\typecheck\dist\index.cjs.js
- E:\workspace\summary-report\node_modules\@vuedx\typecheck\bin\typecheck.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)
    at Function.Module._load (internal/modules/cjs/loader.js:527:27)
    at Module.require (internal/modules/cjs/loader.js:681:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (E:\workspace\summary-report\node_modules\@vuedx\typecheck\dist\index.cjs.js:7:13)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:681:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'E:\\workspace\\summary-report\\node_modules\\@vuedx\\typecheck\\dist\\index.cjs.js',
    'E:\\workspace\\summary-report\\node_modules\\@vuedx\\typecheck\\bin\\typecheck.js'
  ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce
Steps to reproduce the behavior:

  1. run yarn create @vitejs/app
  2. after finish setup, run yarn build
  3. the error message is showing in comand line.

Info (please complete the following information):

  • OS windows
  • IDE vsCode
  • TypeScript Version 4.1.3
  • Vue Version 3.0.5
  • node version 12.3.0

Additional context
i find there is some useful info in here.
so i try change

const FS = require('fs');
const FSP = require('fs/promises');

to

const FS = require('fs');
const FSP = FS.promises;

everything gona ok

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed in insiders buildfixed in insiders build; requires confirmation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions