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

Why do i have Dependency not found fs/promises #316

Closed
Helkyd opened this issue Jan 19, 2022 · 11 comments
Closed

Why do i have Dependency not found fs/promises #316

Helkyd opened this issue Jan 19, 2022 · 11 comments
Labels
build Issue regarding building, serving, or other dev setup. question Further information is requested

Comments

@Helkyd
Copy link

Helkyd commented Jan 19, 2022

Hi,
After cloning a fresh Books from source and going through #264
In which i have done yarn upgrade frappejs and was working...
Now when doing yarn build returns the below error!
image

@18alantom
Copy link
Member

18alantom commented Jan 19, 2022

It probably isn't there in the version of node you are using (FB requires v16.13.1)

A cursory search leads to this: SAP-samples/hana-developer-cli-tool-example#57 Where it was due to an incorrect node version.

Let me know if this isn't the case, else will close the issue soon.

@18alantom 18alantom added build Issue regarding building, serving, or other dev setup. question Further information is requested labels Jan 19, 2022
@Helkyd
Copy link
Author

Helkyd commented Jan 19, 2022 via email

@18alantom
Copy link
Member

What's the output you get on running:

node --version

@Helkyd
Copy link
Author

Helkyd commented Jan 19, 2022

image

@18alantom
Copy link
Member

Hmmm, this is pretty strange 🤨 node 16 should be having fs/promises.

What do you get when you try importing it in the node REPL?

Screen Shot 2022-01-19 at 17 29 23

(ss 👆 for reference)

@Helkyd
Copy link
Author

Helkyd commented Jan 19, 2022

I did get that too... :) but when doing yarn build returns the error on babel and cache-loader

This dependency was not found:

  • fs/promises in ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&

@Helkyd
Copy link
Author

Helkyd commented Jan 19, 2022

I have done following process:
Cloned again books
Changed on backgroup.js and App.vue the "import fs from 'fs/promises';" to "import fs from 'fs';"

1 Deleted the node_modules directory & yarn.lock files
2 Added "webpack": "=4.44.2" (changed ^ to =) dev dependencies in package.json file as per this post.
3 Ran npm i --force command.
4 Then ran npm run electron:serve command.

After all did yarn build and was Ok.

@18alantom
Copy link
Member

Changing to 'fs' from 'fs/promises' without changing the usage will mostly lead to bugs. I'm glad you got it running but the underlying issue is still unclear to me, you also mentioned that this occurred on a fresh clone 🧐

Does this link and serve flow (#315) work for you?

@Helkyd
Copy link
Author

Helkyd commented Jan 20, 2022

So far no other bugs regarding to using 'fs' but of course will check...
Regarding (#315) i did not use yarn upgrade frappejs on the last clean clone code because when doing so and without adding the webpack 4.44.2 it will use the 5.61.0 from frappejs that was creating some issues with the forms i have changed to suit locally.

But of course during the week will give a try following that and see if fs or fs/promises throws bugs.

@18alantom
Copy link
Member

Ah alright; if you get the time, do check once (and let me know) whether that sequence of steps runs without any issues. One of the changes that may cause an issue is switching sqlite3 to the vscode fork.

But since build and publish scripts (CI/CD) are running without issues I'm assuming everything's alright.

Closing since you have resolved the issue using npm

@Helkyd
Copy link
Author

Helkyd commented Jan 20, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issue regarding building, serving, or other dev setup. question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants