bcgov / entity

ServiceBC Registry Team working on Legal Entities
Apache License 2.0
23 stars 58 forks source link

NUXT Build Warning ProseCode #21295

Closed rstens closed 1 month ago

rstens commented 4 months ago

NOTE: We will put you in touch with a team/developer that has expertise in NUXT.

During builds of name-examination the following warnings show up:

WARN  [nuxt] Two component files resolving to the same name ProseCode:                                                                                           9:29:02 a.m.

 - /home/rstens/name-examination/node_modules/@nuxtjs/mdc/dist/runtime/components/prose/ProseCode.vue
 - /home/rstens/name-examination/node_modules/@nuxt/content/dist/runtime/components/Prose/ProseCode.vue

 WARN  [nuxt] Two component files resolving to the same name ProsePre:                                                                                            9:29:02 a.m.

 - /home/rstens/name-examination/node_modules/@nuxtjs/mdc/dist/runtime/components/prose/ProsePre.vue
 - /home/rstens/name-examination/node_modules/@nuxt/content/dist/runtime/components/Prose/ProsePre.vue

Guidance found on this:

As stated in https://github.com/nuxt/content/issues/2266#issuecomment-1720124274 There are no warnings logged with Content v2.8.2 and Nuxt v3.7.2 anymore.

So just upgrade to: nuxt/content >= 2.8.2 and nuxt >= 3.7.2

Make sure to run the following command afterwards ''' npx nuxi upgrade --force ''' It'll delete your lockfile and node_modules folder to make sure you'll get the new versions.

Caveat: Other issues might pop up.

thorwolpert commented 4 months ago

@Mihai-QuickSilverDev I'm not sure Cameron has worked with Nuxt yet. Maybe contact the teams that are?

Mihai-QuickSilverDev commented 4 months ago

Thank you @thorwolpert , I was just the scribe for that comment. I think we knew that Assets completed Vue 3, was not clear if they did Nuxt or not. I think that you led at least a couple of Nuxt implementations - could you recommend a resource for the purposes of this ticket? Alternatively we could contact maybe RTR/Kial. I can also check with Patrick Wei to see if there are any software architecture diagrams identifying what stack each of the teams is on. Thanks again!

thorwolpert commented 4 months ago

I forwarded a link of the app stacks to Omid

eve-git commented 3 months ago

I followed the steps above, set nuxt/content >= 2.8.2 and nuxt >= 3.7.2 The warnings are disappeared and it works.

However, I had to start from downloading the Namex Git repository again. If I don't, any changes cause the following error:

[2:32:27 PM]  ERROR  [uncaughtException] This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Search string not found: "for (const existingRoot of buildInfoVersionMap.roots) {"".

Or other wired errors and warnings....

By the way, running "npx nuxi upgrade --force" installs nuxi@3.12.2. I still got the same error as above or errors like

 ERROR                                                                  3:29:40 PM
 ERROR(vue-tsc)  Cannot find module '~/components/search/ResultsBox.vue' or its corresponding type declarations.
 FILE  /home/evedeng/projects/name-examination/app/tests/component/SearchResultsBox.spec.ts:3:30

    1 | import { beforeEach, describe, it, expect } from 'vitest'
    2 | import { mount } from '@vue/test-utils'
  > 3 | import SearchResultsBox from '~/components/search/ResultsBox.vue'
      |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    4 | import mockNameRequests from '../data/mockNameRequests.json'
    5 | import mockZeroNameRequests from '../data/mockZeroNameRequests.json'
    6 | import { useSearchStore } from '~/store/search'

It is frustrating.

eve-git commented 3 months ago

@rarmitag do you think I can commit code? Do you know how to resolve the error?

eve-git commented 3 months ago

steps:

  1. clone a clean name-examination to disk
  2. modify package.json:
    "@nuxt/content": "^2.8.2",
    "nuxt": ^3.7.2

    run:

    > npm i
    > npm run dev

    The app starts without the warning

check nuxt version:

name-examination@1.2.20 /home/evedeng/projects/name-examination/app
├─┬ @nuxt/content@2.12.1
│ └─┬ @vueuse/nuxt@10.9.0
│   └── nuxt@3.12.2 deduped
└── nuxt@3.12.2
hanlunBCRegistries commented 1 month ago

There is no need to test in the UI. It's a build warning, so since the warning is fixed, we can move it to "Done".