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

SyntaxError: The requested module 'mem-fs' does not provide an export named 'loadFile', SyntaxError: The requested module 'mem-fs' does not provide an export named 'isFileTransform', sharedFs.pipeline is not a function #803

Open
MahmoudY3c opened this issue Dec 31, 2023 · 2 comments

Comments

@MahmoudY3c
Copy link

Type of issue

  • Hello, I installed yo + generator-code as a dev dependancies by yarn then when ever I try to run npx yo code in the first time I got
import { loadFile } from 'mem-fs';
         ^^^^^^^^
SyntaxError: The requested module 'mem-fs' does not provide an export named 'loadFile'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:213:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
    at async pre (E:\VSCODE Extensions\locales generator\node_modules\yo\lib\cli.js:83:3)
    at async E:\VSCODE Extensions\locales generator\node_modules\yo\lib\cli.js:193:3
  • So I navigated to mem-fs library to export it and after export it I got the following error
file:///E:/VSCODE%20Extensions/locales%20generator/node_modules/mem-fs-editor/dist/actions/commit.js:1
import { isFileTransform } from 'mem-fs';
         ^^^^^^^^^^^^^^^
SyntaxError: The requested module 'mem-fs' does not provide an export named 'isFileTransform'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:213:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
    at async pre (E:\VSCODE Extensions\locales generator\node_modules\yo\lib\cli.js:83:3)
    at async E:\VSCODE Extensions\locales generator\node_modules\yo\lib\cli.js:193:3
  • So as a try I tried to remove export it because I couldn't find it in mem-fs so i replaced it by true and the tool is running but after questions and when it comes to the last step to generate the files I got that error
Writing in E:\VSCODE Extensions\locales generator\localesgen...
Error code 

sharedFs.pipeline is not a function
  • Please release a new update to fix those issues

My environment

  • OS version/details: Windows 10 64-bit
  • Node version: 20.9.0
  • yarn version: 1.22.21
  • Version of yo : 5.0.0

Expected behavior

  • Just run and ask the questions then generate the files

Current behavior

  • Just a collection of errors
@nefrob
Copy link

nefrob commented Jan 6, 2024

Also tested on the following without success:

  • OS: Alpine, Debian bookworm (both via docker node image), MacOs Ventura 13.6.2
  • Node versions: 18.19.0, 20.9.0
  • yarn versions: 1.22.21, 4.0.2
  • Version of yo : 5.0.0

Switching to using npm resolves the issue so I'm not sure why it is failing with yarn. Not sure, but this might also be related to #800.

@esskayesss
Copy link

It's failing even with pnpm. Again, switching to npm resolves the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants