Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
illuSioN4ng opened this issue Jan 5, 2021 · 2 comments
Labels
bug Something isn't working fixed in insiders build fixed in insiders build; requires confirmation

Comments

@illuSioN4ng
Copy link

illuSioN4ng commented Jan 5, 2021

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

@illuSioN4ng illuSioN4ng added the bug Something isn't working label Jan 5, 2021
@stephen-yau
Copy link

Try it on node v14.x , it should work with node v14.x

@znck znck added the fixed in insiders build fixed in insiders build; requires confirmation label Jan 12, 2021
@znck
Copy link
Collaborator

znck commented Jan 12, 2021

Duplicated by #147

@znck znck closed this as completed Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in insiders build fixed in insiders build; requires confirmation
Projects
None yet
Development

No branches or pull requests

3 participants