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

Unable to import FS #244

Closed
Jake-Samuels opened this issue Jun 6, 2024 · 1 comment
Closed

Unable to import FS #244

Jake-Samuels opened this issue Jun 6, 2024 · 1 comment

Comments

@Jake-Samuels
Copy link

I'm trying to import FS in order to write the outputs of each conversation to a JSON file, but importing the FS module returns the following error:

X [ERROR] Could not resolve "fs"

convex/messages.ts:5:20:
  5 │ import * as fs from "fs";
    ╵                     ~~~~

The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle
for node? You can use "platform: 'node'" to do that, which will remove this error.

Any ideas how to fix this? I've tried adding FS directly to the node_modules directory but it isn't able to import it.

@ianmacartney
Copy link
Collaborator

This isn't running in a node server and it doesn't have access to the filesystem. The conversations are already being written to the database - you could write to another table in a different format, if you want it in a different format than it's already in? You can dump the database with just convex export and there will be a .jsonl file with the messages, but you'll have to connect them with their associated conversations. make sense?

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

2 participants