magnetar icon indicating copy to clipboard operation
magnetar copied to clipboard

set up nuxt example

Open mesqueeb opened this issue 3 years ago • 9 comments

  • set up nuxt example
  • can be added as dev-nuxt-firestore in the packages folder
  • can be based on the dev-vue3-firestore code, which is a minimal use case of magnetar with Vue 3.

image

mesqueeb avatar Dec 19 '22 01:12 mesqueeb

working at nuxt branch https://github.com/CyCraft/magnetar/tree/nuxt

kazupon avatar Jan 21 '23 09:01 kazupon

I start to work today (1/21)

kazupon avatar Jan 21 '23 09:01 kazupon

ERROR Cannot set properties of undefined (setting 'id')

Hmm, This error is occuring in @vitejs/plugin-vue:

$ DEBUG=* pnpm dev:nuxt-firestore
 ERROR  Cannot set properties of undefined (setting 'id')                                                                                   19:41:24

› Warmup for /@fs/path/to/CyCraft/magnetar/node_modules/.pnpm/[email protected]/node_modules/nuxt/dist/app/components/nuxt-root.vue failed with: Cannot set properties of undefined (setting 'id')

  at createDescriptor (/path/to/CyCraft/magnetar/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:67:17)
  at transformMain (/path/to/CyCraft/magnetar/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:2213:34)
  at TransformContext.transform (/path/to/CyCraft/magnetar/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:2702:16)
  at Object.transform (/path/to/CyCraft/magnetar/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:40534:44)
  at async loadAndTransform (/path/to/CyCraft/magnetar/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:36921:29)

kazupon avatar Jan 21 '23 10:01 kazupon

Okay, I've gotten the cause of the error. multiple @vue/compiler-sfc versions was installed in repo

  /@vue/compiler-sfc/2.7.14:
    resolution: {integrity: sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==}
    dependencies:
      '@babel/parser': 7.20.7
      postcss: 8.4.21
      source-map: 0.6.1

  /@vue/compiler-sfc/3.2.45:
    resolution: {integrity: sha512-1jXDuWah1ggsnSAOGsec8cFjT/K6TMZ0sPL3o3d84Ft2AYZi2jWJgRMjw4iaK0rBfA89L5gw427H4n1RZQBu6Q==}
    dependencies:
      '@babel/parser': 7.20.7
      '@vue/compiler-core': 3.2.45
      '@vue/compiler-dom': 3.2.45
      '@vue/compiler-ssr': 3.2.45
      '@vue/reactivity-transform': 3.2.45
      '@vue/shared': 3.2.45
      estree-walker: 2.0.2
      magic-string: 0.25.9
      postcss: 8.4.21
      source-map: 0.6.1

When we start pnpm dev:nuxt-firestore, @vue/compiler-sfc/2.7.14 is loaded in nuxt.

The deps of dev-vue2-firestore should not be hoisted to root.

kazupon avatar Jan 21 '23 11:01 kazupon

I stop to work for house chores (1/21) 2:25

kazupon avatar Jan 21 '23 11:01 kazupon

I start to work today (1/29)

I'll remove dev-vue2-firestore from magnetar monorepo

kazupon avatar Jan 29 '23 13:01 kazupon

I've stopped to work today. 2.5 h I've set up initialize magnetar on Nuxt https://github.com/CyCraft/magnetar/pull/105/commits/842d58bd08db388ab09d00230076d8bd41da2df3

kazupon avatar Jan 29 '23 16:01 kazupon

I start to work today (1/31)

kazupon avatar Jan 31 '23 14:01 kazupon

I've stopped to work today. 1.5 h

kazupon avatar Jan 31 '23 16:01 kazupon