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

Fix in parser #285

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

CaioHVectorA
Copy link
Contributor

Im was doing the @palmares/database setup, and when i run this query:

import './database.config';
import { Company, User } from './models';
await Company.default.set((qs) =>
  qs
    .join(User, 'usersOfCompany', (qs) =>
      qs.data(
        {
          firstName: 'Foo',
          lastName: 'bar',
          email: '[email protected]',
          isActive: true,
        },
        {
          firstName: 'John',
          lastName: 'Doe',
          email: '[email protected]',
          isActive: true,
        }
      )
    )
    .data({
      name: 'Evil Foo',
      slug: 'evil-foo',
      isActive: true,
    })
);

i got this error:
const existingOutputParser = field["__outputParsers"].get(engine.connectionName);
^
TypeError: Cannot read properties of undefined (reading '__outputParsers')
at retrieveInputAndOutputParsersFromFieldAndCache (C:\Users\Caio\Documents\develop\palmares-testing\node_modules@palmares\databases\dist\src\index.js:3611:37)

  const existingOutputParser = field["__outputParsers"].get(engine.connectionName);
  const existingInputParser = field["__inputParsers"].get(engine.connectionName);

Using some console.log's, i see that field are getting undefined. So, in a fast solution, i added an
if (!field) return in top of the function, and run my queries file, and its run fine at my database. But idk if is a optimal solution

Copy link

changeset-bot bot commented Nov 10, 2024

🦋 Changeset detected

Latest commit: c75992e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@palmares/databases Patch
@tests/databases Patch
@tests/schemas Patch
@palmares/schemas Patch
@palmares/drizzle-engine Patch
@palmares/sequelize-engine Patch
@palmares/zod-schema Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added main Changing one of the core packages, take caution databases Just a package, can change freely labels Nov 10, 2024
@CaioHVectorA CaioHVectorA reopened this Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
databases Just a package, can change freely main Changing one of the core packages, take caution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant