Skip to content

fix(pinia-orm): Nuxt2 with composition api not working#228

Merged
CodeDredd merged 6 commits intonext-releasefrom
pinia-orm-216
Aug 20, 2022
Merged

fix(pinia-orm): Nuxt2 with composition api not working#228
CodeDredd merged 6 commits intonext-releasefrom
pinia-orm-216

Conversation

@CodeDredd
Copy link
Copy Markdown
Owner

Issues

close #216

Context

Somehow nuxt 2 is not transpiling cjs files correctly with babel. If the build files are renamed to js then everything works. Also no workaround or related topic worked to fix this behaviour on nuxt 2 side.
Tried solutions: nuxt/nuxt#7722

For nuxt2 with composition api now the pinia store has to be passed to the useRepo function

...
const { $pinia } = useContext()
const userRepo = useRepo(User, $pinia)
...

renovate bot and others added 6 commits August 19, 2022 18:00
# Conflicts:
#	packages/nuxt/package.json
#	packages/pinia-orm/package.json
#	pnpm-lock.yaml
- Nuxt 2 somehow doesnt run babel with `cjs` files and therefor features like "nullish coalescing operator" are not working. As a workaround the files are renamed to 'js'
- Also fixed the new uid decorators not working correctly
- Added an option to pass `pinia` to the store instance to be able to use it outside of `setup`
@CodeDredd CodeDredd added bug Something isn't working enhancement New feature or request labels Aug 20, 2022
@CodeDredd CodeDredd merged commit 6636fc0 into next-release Aug 20, 2022
@CodeDredd CodeDredd deleted the pinia-orm-216 branch August 20, 2022 10:42
@CodeDredd CodeDredd mentioned this pull request Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant