'"convex/schema"' has no exported member 'defineSchema'
I'm seeing this with a new vue project
Any thoughts?
15 Replies
Somewhat of a guess, but do you have a tsconfig somewhere with
baseUrl: "."
?
There were some similar sounding issues where the compiler / build system would confuse the convex/schema.ts
file with the convex/schema
npm package.
The other thing to try to see if this could be the issue would be renaming your convex
directory (but this is fairly annoying)I do have baseUrl
getting rid of That fixed
Removing the
baseUrl: "."
should hopefully fix this issue, but could potentially break other imports in your project.
Did you create this project from npm init vue@latest
or a similar template? Would love to see what the template is doing and hopefully try and avoid this issue for future Vue projectsI used this:npm create vue@3
yarn build is still complaining about moret hings
It's confusing to me as to why build is touching things in convex/ directory
When you run TypeScript on client code it follows the types if that code ever imports from convex/_generated/api.d.ts
you probably do want to install those node types to use process in Convex functions
Convex seems to have no problem
I have installed those types
Here is my main tsconfig:

ahh it's not in the compiler options
The typescript error could be better:
they could specify compilerOptions ;-/
Thanks Tom
I hope that deleting the "types" field altogether would also work
I'm still struggling with typescript 😕 I can start another thread if you want, but I just started getting new errors:
and
When I tried to import { Id }
Okay it's when I try to call new Id("users", userid)
Is there a generally accepted way to deal with returning javascript objects that have hyphens in their keys?
I'm having to serialize my nice object to JSON, and rehydrate it in the browser
Good question! Going to answer momentarily in https://discord.com/channels/1019350475847499849/1088907682125185136
I'm still having trouble using Id<> in my client code
This is still happening

sounds like https://github.com/uhop/node-re2/issues/92, is this library being used in a Convex function?
GitHub
Issues · uhop/node-re2
node.js bindings for RE2: fast, safe alternative to backtracking regular expression engines. - Issues · uhop/node-re2
Curious to see the Id thing, where is Id being imported from and what does it look like when hovered?
Looks like some libraries have made re2 optional to work around this, what's the explicit dependency that is pulling re2 in transitively?