sapporo-wes / sapporo-web

A web application for managing and executing WES services.
https://sapporo-wes.github.io/sapporo-web/
Apache License 2.0
9 stars 9 forks source link

Nuxt build error #37

Closed weber8thomas closed 1 year ago

weber8thomas commented 1 year ago

Hi,

I would like to set up the developer version of sapporo-web following the tutorial. I'm facing the following issue:

yarl install

❯ yarn install
yarn install v1.22.19
warning ../../package.json: No license field
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍  Resolving packages...
warning nuxt > @nuxt/webpack > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
warning nuxt > @nuxt/webpack > webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning nuxt > @nuxt/webpack > terser-webpack-plugin > cacache > @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
warning nuxt > @nuxt/webpack > webpack > node-libs-browser > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning nuxt > @nuxt/webpack > webpack > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning nuxt > @nuxt/webpack > cssnano > cssnano-preset-default > postcss-svgo > svgo > stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
warning nuxt > @nuxt/webpack > webpack > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning nuxt > @nuxt/webpack > webpack > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning nuxt > @nuxt/webpack > webpack > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning vuex-persistedstate@3.2.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning vuex-persistedstate > shvl@2.0.3: older versions vulnerable to prototype pollution
warning @nuxt/types > @types/autoprefixer > @types/browserslist@4.15.0: This is a stub types definition. browserslist provides its own type definitions, so you do not need this installed.
warning @nuxt/types > @types/webpack-dev-middleware@5.3.0: This is a stub types definition. webpack-dev-middleware provides its own type definitions, so you do not need this installed.
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "nuxt > @nuxt/components@2.2.1" has unmet peer dependency "consola@*".
warning " > vuex-persistedstate@3.2.1" has unmet peer dependency "vuex@^2.0.0 || ^3.0.0".
warning " > @babel/eslint-parser@7.19.1" has unmet peer dependency "@babel/core@>=7.11.0".
warning "@nuxt/types > @types/webpack-dev-middleware > webpack-dev-middleware@6.0.1" has incorrect peer dependency "webpack@^5.0.0".
warning "@nuxtjs/eslint-config-typescript > eslint-import-resolver-typescript@2.7.1" has unmet peer dependency "eslint-plugin-import@*".
warning "@nuxtjs/eslint-config-typescript > @nuxtjs/eslint-config > eslint-plugin-promise@5.2.0" has incorrect peer dependency "eslint@^7.0.0".
warning "@nuxtjs/eslint-config-typescript > @nuxtjs/eslint-config > eslint-config-standard@16.0.3" has incorrect peer dependency "eslint@^7.12.1".
warning "@nuxtjs/eslint-config-typescript > @typescript-eslint/eslint-plugin > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning Workspaces can only be enabled in private projects.
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
✨  Done in 68.01s.

yarn generate

❯ yarn generate
yarn run v1.22.19
warning ../../package.json: No license field
$ NODE_OPTIONS=--openssl-legacy-provider nuxt generate
/opt/homebrew/Cellar/node/19.7.0/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
error Command failed with exit code 9.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

After removing the NODE_OPTIONS from the command

❯ yarn generate
yarn run v1.22.19
warning ../../package.json: No license field
$ nuxt generate

 WARN  When using nuxt generate, you should set target: 'static' in your nuxt.config                                                                                                                     12:31:10
       👉 Learn more about it on https://go.nuxtjs.dev/static-target

ℹ Production build                                                                                                                                                                                       12:31:11
ℹ Bundling only for client side                                                                                                                                                                          12:31:11
ℹ Target: static                                                                                                                                                                                         12:31:11
✔ Builder initialized                                                                                                                                                                                    12:31:11
✔ Nuxt files generated                                                                                                                                                                                   12:31:11

✖ Client
  Compiled with some errors in 11.98s

Hash: cf8ca3e134c05a78ecfc
Version: webpack 4.46.0
Time: 11979ms
Built at: 03/07/2023 12:31:23 PM
                         Asset       Size  Chunks               Chunk Names
                    17a0f36.js    2.4 KiB      11  [immutable]  runtime
                    4ccb4b2.js   6.09 KiB       9  [immutable]  pages/state/index
                    52841eb.js   38.2 KiB      10  [immutable]  pages/workflows/index
                    777f1c4.js    217 KiB       1  [immutable]  vendors/pages/runs/index/pages/services/index/pages/workflows/index
                    7be2746.js   32.5 KiB       3  [immutable]  vendors/pages/runs/index/pages/services/index
                    96875b2.js    220 KiB       0  [immutable]  vendors/pages/index/pages/runs/index/pages/services/index/pages/workflows/index
                      LICENSES  559 bytes
                    a14185d.js   21.6 KiB       2  [immutable]  vendors/pages/index/pages/services/index
                    b836271.js   89.8 KiB       4  [immutable]  app
                    c48b89b.js   12.6 KiB       6  [immutable]  pages/index
                    cba0d1a.js    250 KiB       5  [immutable]  commons/app
                    da20b7b.js   69.6 KiB       8  [immutable]  pages/services/index
                    eeab515.js   18.5 KiB       7  [immutable]  pages/runs/index
                    ef4a9ff.js    565 KiB      12  [immutable]  vendors/app
                    fc18fb3.js   27.7 KiB      13  [immutable]  vendors/pages/workflows/index
      img/cwl-icon.a6303fb.png   3.31 KiB          [immutable]
          img/logo.80d06f1.svg   5.45 KiB          [immutable]
 img/nextflow-icon.8b640bb.png   8.47 KiB          [immutable]
img/snakemake-icon.0d1d51a.png   2.17 KiB          [immutable]
      img/wdl-icon.f98ef71.png   1.89 KiB          [immutable]
Entrypoint app = 17a0f36.js cba0d1a.js ef4a9ff.js b836271.js

ERROR in src/components/services/WorkflowRegisterDialog.vue:365:12
TS2339: Property 'dialogShowModel' does not exist on type 'CreateComponentPublicInstance<ExtractPropTypes<{ dialogShow: { type: BooleanConstructor; default: boolean; required: true; }; serviceId: { type: StringConstructor; required: true; }; }>, ... 16 more ..., {}>'.
    363 |
    364 |     dialogShow() {
  > 365 |       this.dialogShowModel = this.dialogShow
        |            ^^^^^^^^^^^^^^^
    366 |     },
    367 |   },
    368 |

ERROR in src/pages/services/index.vue:55:71
TS2339: Property 'serviceId' does not exist on type 'CreateComponentPublicInstance<{}, unknown, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, {}, {}, false, OptionTypesType<{}, {}, {}, {}, {}, {}>, ... 5 more ..., {}>'.
    53 |   computed: {
    54 |     existServiceId() {
  > 55 |       return this.$store.getters['services/serviceIds'].includes(this.serviceId)
       |                                                                       ^^^^^^^^^
    56 |     },
    57 |
    58 |     serviceId() {

ERROR in src/plugins/loadPreRegisteredServices.ts:6:18
TS2430: Interface 'MyWindow' incorrectly extends interface 'Window'.
  Types of property 'onNuxtReady' are incompatible.
    Type '(obj: () => void) => void' is not assignable to type '(cb: (app: NuxtApp) => void) => void'.
      Types of parameters 'obj' and 'cb' are incompatible.
    4 | import { Service } from '@/store/services'
    5 |
  > 6 | export interface MyWindow extends Window {
      |                  ^^^^^^^^
    7 |   onNuxtReady(obj: () => void): void
    8 | }
    9 | declare let window: MyWindow

ERROR in src/plugins/localStorage.ts:7:18
TS2430: Interface 'MyWindow' incorrectly extends interface 'Window'.
  Types of property 'onNuxtReady' are incompatible.
    Type '(obj: () => void) => void' is not assignable to type '(cb: (app: NuxtApp) => void) => void'.
      Types of parameters 'obj' and 'cb' are incompatible.
     5 | const ls = new SecureLS({ isCompression: false })
     6 |
  >  7 | export interface MyWindow extends Window {
       |                  ^^^^^^^^
     8 |   onNuxtReady(obj: () => void): void
     9 | }
    10 | declare let window: MyWindow

 FATAL  Nuxt build error                                                                                                                                                                                 12:31:23

  at WebpackBundler.webpackCompile (node_modules/@nuxt/webpack/dist/webpack.js:1814:21)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async WebpackBundler.build (node_modules/@nuxt/webpack/dist/webpack.js:1779:5)
  at async Builder.build (node_modules/@nuxt/builder/dist/builder.js:249:5)
  at async Generator.initiate (node_modules/@nuxt/generator/dist/generator.js:81:7)
  at async Generator.generate (node_modules/@nuxt/generator/dist/generator.js:53:5)
  at async Object.run (node_modules/@nuxt/cli/dist/cli-generate.js:263:24)
  at async NuxtCommand.run (node_modules/@nuxt/cli/dist/cli-index.js:356:7)

   ╭─────────────────────────────╮
   │                             │
   │   ✖ Nuxt Fatal Error        │
   │                             │
   │   Error: Nuxt build error   │
   │                             │
   ╰─────────────────────────────╯

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

❯ yarn --version 1.22.19 ❯ npx --version 9.5.0

System: macOS 13.0 (22A380) Chip: M1 Max

Thanks in advance for your help,

Best,

Thomas

suecharo commented 1 year ago

Thanks, Mr. Thomas (@weber8thomas).

Your point is correct, and this is due to our failure to update our documentation. We are updating the document now and would appreciate a few hours of your patience.

Best,

Hero

suecharo commented 1 year ago

@weber8thomas

I have updated the text, links, and commands in the tutorial. (I apologize as the screenshot has not been updated.) Currently, npm is being used instead of yarn.

I have replicated what you were trying to do when using npm. Below is the log:

Sapporo-web version:

$ git log --oneline | head -n 5
418673f Update version to 1.2.2
c6400ba Fix outputs bug
f584b35 Update version to 1.2.1
0968e6d Support Chrome's Mixed Content checl
42d4cd4 Fix docker env
$ git clean -fdx

Commands:

$ npm ci
...
added 1539 packages, and audited 1540 packages in 36s
...

$ npm run generate

> sapporo-web@1.2.2 generate
> NODE_OPTIONS=--openssl-legacy-provider nuxt generate

 Production build                                                       21:36:57
ℹ Bundling only for client side                                          21:36:57
ℹ Target: static                                                         21:36:57
✔ Builder initialized                                                    21:36:57
✔ Nuxt files generated                                                   21:36:57

...

Hash: 969cf97e4ccbba43b23c
Version: webpack 4.46.0
Time: 59253ms
Built at: 03/07/2023 9:37:58 PM
                         Asset       Size  Chunks                                Chunk Names
../server/client.manifest.json   36.3 KiB          [emitted]
                    1dcf984.js    2.4 KiB      11  [emitted] [immutable]         runtime
                    2d586d7.js   90.3 KiB       4  [emitted] [immutable]         app
                    2e35c32.js    218 KiB       0  [emitted] [immutable]         vendors/pages/index/pages/runs/index/pages/services/index/pages/workflows/index
                    310cf3e.js   21.6 KiB       2  [emitted] [immutable]         vendors/pages/index/pages/services/index
                    373fe93.js   71.2 KiB       8  [emitted] [immutable]         pages/services/index
                    5a94cac.js   19.3 KiB       7  [emitted] [immutable]         pages/runs/index
                    6d20400.js   27.5 KiB      13  [emitted] [immutable]         vendors/pages/workflows/index
                    6e17154.js   13.3 KiB       6  [emitted] [immutable]         pages/index
                    81a0b26.js   39.1 KiB      10  [emitted] [immutable]         pages/workflows/index
                    94a1cd3.js    216 KiB       1  [emitted] [immutable]         vendors/pages/runs/index/pages/services/index/pages/workflows/index
                      LICENSES  630 bytes          [emitted]
                    adf3be8.js   6.24 KiB       9  [emitted] [immutable]         pages/state/index
                    adfc6b3.js   32.4 KiB       3  [emitted] [immutable]         vendors/pages/runs/index/pages/services/index
                    d0fc82b.js    244 KiB       5  [emitted] [immutable]  [big]  commons/app
                    e0a5613.js    567 KiB      12  [emitted] [immutable]  [big]  vendors/app
      img/cwl-icon.d6a463e.png   3.31 KiB          [emitted] [immutable]
          img/logo.c93d28a.svg   5.45 KiB          [emitted] [immutable]
 img/nextflow-icon.5351591.png   8.47 KiB          [emitted] [immutable]
img/snakemake-icon.b8289bc.png   2.17 KiB          [emitted] [immutable]
      img/wdl-icon.3954ce4.png   1.89 KiB          [emitted] [immutable]
 + 1 hidden asset
Entrypoint app = 1dcf984.js d0fc82b.js e0a5613.js 2d586d7.js

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  d0fc82b.js (244 KiB)
  e0a5613.js (567 KiB)
ℹ Generating output directory: dist/                                     21:37:58
ℹ Generating pages                                                       21:37:59
✔ Generated route "/runs"                                                21:37:59
✔ Generated route "/services"                                            21:37:59
✔ Generated route "/state"                                               21:37:59
✔ Generated route "/workflows"                                           21:37:59
✔ Generated route "/"                                                    21:37:59
✔ Client-side fallback created: 404.html                                 21:37:59

We apologize for any inconvenience caused. Thank you for your comment.

weber8thomas commented 1 year ago

@suecharo thanks a lot, you were really responsive! This is now working Cheers, Thomas