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

Model's data not populated #1751

Closed
olinox14 opened this issue Dec 11, 2023 · 2 comments
Closed

Model's data not populated #1751

olinox14 opened this issue Dec 11, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@olinox14
Copy link

Environment

See on stackblitz

Reproduction

https://stackblitz.com/edit/nuxt-starter-mhusga?file=app.vue

Describe the bug

I've got a custom model extending the pinia Model class. When I create a new instance of this model, either using repo.make(data) or the constructor, the resulting instance is empty :

const data = { id: 123 };

const repo = useRepo(MyProfile);
const profile = repo.make(data);

console.log(profile);

results in :

MyProfile {}

Additional context

No response

Logs

No response

@olinox14
Copy link
Author

Update: it turned out that adding this to the nuxt.config.ts solves the problem

vite: {
    esbuild: {
        drop: process.env.DEBUG ? [] : ['console', 'debugger'],
            tsconfigRaw: {
            compilerOptions: {
                experimentalDecorators: true,
            }
        }
    }
}

@CodeDredd
Copy link
Owner

related to #1610

@CodeDredd CodeDredd added duplicate This issue or pull request already exists and removed pending triage labels Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants