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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 [BUG]: Module not found: Error: Can't resolve 'fs' #52

Open
3 tasks done
therealsujitk opened this issue Aug 7, 2023 · 11 comments 路 May be fixed by #56
Open
3 tasks done

馃悰 [BUG]: Module not found: Error: Can't resolve 'fs' #52

therealsujitk opened this issue Aug 7, 2023 · 11 comments 路 May be fixed by #56
Assignees
Labels
bug Something isn't working

Comments

@therealsujitk
Copy link

Prerequisites

  • I have searched the issues and believe that it has not already been reported
  • It occurs on the latest version of bard-ai
  • I have read the FAQ and there are no solutions there

Bug Description

This happens when I try to build my chrome extension that uses this package.

Module not found: Error: Can't resolve 'fs' in '/Users/sujit/Documents/My Projects/chrome-ext-litcode-solver/node_modules/bard-ai'

Reproduction Steps

  1. Create a sample application meant for the front-end (For example a website/extension).
  2. Add some bard sample code that will be executed on the front-end (This probably won't work for a website due to CORS policy, but will work for chrome extensions).
  3. fs cannot be imported because it is a server-side module, so it'll throw some kind of error.

Other information

No response

Occurance Rate

I can reproduce this bug 100% of the time.

@therealsujitk therealsujitk added the bug Something isn't working label Aug 7, 2023
@EvanZhouDev
Copy link
Owner

Update to 2.0.2. It was fixed.

@therealsujitk
Copy link
Author

@EvanZhouDev are you sure? I just tested it and I still get the error.

@EvanZhouDev
Copy link
Owner

Are you on 2.0.2? It should be fixed in #51

@therealsujitk
Copy link
Author

therealsujitk commented Aug 7, 2023

I am on 2.0.2, building still gives the same error.

npm i bard-ai@2.0.2

@EvanZhouDev
Copy link
Owner

Very strange... I'll have a look at this in a little bit

@EvanZhouDev EvanZhouDev reopened this Aug 7, 2023
@ThatXliner ThatXliner assigned ThatXliner and unassigned ThatXliner Aug 7, 2023
@ThatXliner
Copy link
Collaborator

May I see your code? It seems to be that you're trying to use a NodeJS-only feature in the browser. Importingbard-ai v2.0.2 seems to be fine

@therealsujitk
Copy link
Author

therealsujitk commented Aug 14, 2023

@ThatXliner sorry for the late response, was a bit busy. This is the code that uses the bard-ai package. The build works when I comment out all of this code including the import statement. Even adding the import alone causes the build to fail with bard-ai@2.0.3.

@rafalinliyosar
Copy link

rafalinliyosar commented Aug 14, 2023

@ThatXliner sorry for the late response, was a bit busy. This is the code that uses the bard-ai package. The build works when I comment out all of this code including the import statement. Even adding the import alone causes the build to fail with bard-ai@2.0.3.

same issue here, creating basic code put in github page also is causing error

@anirudhv
Copy link

Also facing same issue

@ThatXliner ThatXliner linked a pull request Aug 15, 2023 that will close this issue
@ThatXliner ThatXliner pinned this issue Aug 15, 2023
@makhdum530
Copy link

same issue face in use in next js

@DiegoVenancioVieira
Copy link

same problem angular 17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants