bard-ai
bard-ai copied to clipboard
🐛 [BUG]: Module not found: Error: Can't resolve 'fs'
Prerequisites
- [X] I have searched the issues and believe that it has not already been reported
- [X] It occurs on the latest version of
bard-ai - [X] 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
- Create a sample application meant for the front-end (For example a website/extension).
- 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).
fscannot 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.
Update to 2.0.2. It was fixed.
@EvanZhouDev are you sure? I just tested it and I still get the error.
Are you on 2.0.2? It should be fixed in #51
Very strange... I'll have a look at this in a little bit
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
@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 [email protected].
@ThatXliner sorry for the late response, was a bit busy. This is the code that uses the
bard-aipackage. 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[email protected].
same issue here, creating basic code put in github page also is causing error
Also facing same issue
same issue face in use in next js
same problem angular 17