Closed marco-varias closed 2 years ago
i hate this bug with webpack4 and i dont know why yet...
@marco-varias For now you use "v1.0.0-rc.4" which seems to work. Have to find out now what is wrong with rc.5
@marco-varias Now with the new release everything should be fine. How to use it nuxt2 is described here: https://pinia-orm.codedredd.de/guide/nuxt/setup#usage-on-nuxt-2
Edit - fixed this by adding 'pinia-orm'
to the build transpile array. Wasn't sure this was needed with Nuxt Bridge but since i'm still using Webpack it seems it is :)
i am seeing this error with pinia-orm 1.2.2
, pinia-orm/nuxt 1.1.4
, and Nuxt Bridge:
ERROR in ./node_modules/pinia-orm/dist/index.mjs friendly-errors 16:56:32
Module parse failed: Unexpected token (83:39) friendly-errors 16:56:32
File was processed with these loaders:
* ./node_modules/@nuxt/bridge/node_modules/unplugin/dist/webpack/loaders/transform.js
You may need an additional loader to handle the result of these loaders.
| const type = model[this.morphType];
| const id = model[this.morphId];
> const related = dictionary[type]?.[id] ?? null;
| model.$setRelation(relation, related);
| });
friendly-errors 16:56:32
@ ./plugins/pinia-orm.js 3:0-38 5:18-27
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
Reproduction
I'm currently trying to migrate our vuex-orm project to use pinia + pinia-orm. Sadly though, I haven't been able to install pinia(-orm) without getting errors.
I already tried the steps mentioned in the docs about Nuxt2, making my package.json look like:
I still get the errors from Nuxt stating:
Making me think the
??
operator is not supported. My nuxt.config.js is as follows as well:Steps to reproduce the behavior
Expected behavior
A working Nuxt2 installation.
Actual behavior
The error mentioned above.