zammad / zammad

Zammad is a web based open source helpdesk/customer support system
https://zammad.org
GNU Affero General Public License v3.0
4.24k stars 731 forks source link

After upgrade asset:precompile fail with TypeError: [vite-plugin-pwa:build] compilerCore.isBuiltInType is not a function #5251

Closed NiTRoeSE closed 2 days ago

NiTRoeSE commented 3 days ago

Used Zammad Version

6.3.1-1720073544.96130907.jammy

Environment

Actual behaviour

Running zammad run rake assets:precompile --trace fails with error message:

** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Execute assets:precompile
** Invoke vite:install_dependencies (first_time)
** Execute vite:install_dependencies
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.48s.
** Invoke vite:build_all (first_time)
** Invoke vite:verify_install (first_time)
** Invoke environment
** Execute vite:verify_install
** Execute vite:build_all
Building with Vite ⚡️
vite v5.2.6 building for production...
transforming...
✓ 5 modules transformed.
x Build failed in 519ms
error during build:
TypeError: [vite-plugin-pwa:build] compilerCore.isBuiltInType is not a function
file: /opt/zammad/app/frontend/apps/mobile/AppMobile.vue
    at Object.isBuiltInComponent (/opt/zammad/node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js:2380:22)
    at isComponent (/opt/zammad/node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:2619:152)
    at onCloseTag (/opt/zammad/node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:2551:16)
    at Object.onclosetag (/opt/zammad/node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:2186:13)
    at Tokenizer.stateInClosingTagName (/opt/zammad/node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:749:16)
    at Tokenizer.stateInRCDATA (/opt/zammad/node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:592:14)
    at Tokenizer.parse (/opt/zammad/node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:1055:16)
    at Object.baseParse (/opt/zammad/node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:2820:13)
    at Object.parse (/opt/zammad/node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js:2956:23)
    at Object.parse$2 [as parse] (/opt/zammad/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:1851:24)
    at createDescriptor (file:///opt/zammad/node_modules/@vitejs/plugin-vue/dist/index.mjs:74:43)
    at transformMain (file:///opt/zammad/node_modules/@vitejs/plugin-vue/dist/index.mjs:2367:34)
    at Object.transform (file:///opt/zammad/node_modules/@vitejs/plugin-vue/dist/index.mjs:2910:16)
    at file:///opt/zammad/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:19563:40

pid 3126 exit 1
Build with Vite failed! ❌

Expected behaviour

Running zammad run rake assets:precompile --trace works.

Steps to reproduce the behaviour

  1. create a custom css file /opt/zammad/app/assets/stylesheets/custom/custom.css and/or modify /opt/zammad/app/assets/javascripts/app/views/login.jst.eco
  2. run zammad run rake assets:precompile --trace to apply your changes

Support Ticket

No response

I'm sure this is a bug and no feature request or a general question.

yes

rixx commented 3 days ago

I'm seeing the same behaviour without having a custom CSS file.

rixx commented 3 days ago

Things I tried:

So tl;dr: remove your node_packages and you should be fine.

NiTRoeSE commented 2 days ago

Things I tried:

* Ran `bundle exec vite upgrade`as indicated by the `bundle install` prompt: no change

* Removed the `node_modules` directory [as per forum](https://community.zammad.org/t/error-during-update-from-6-2-to-6-3/14044/9), which also includes more possible commands to run:  fixed this problem, but made me run into [rollup errors](https://community.zammad.org/t/error-vite-plugin-pwa-build-vite-rollup-failed-to-resolve-import/14730/4)

* Ran `yarn cache clean && rake vite:clobber`: Same rollup error. In the end, I had to manually fix the incorrect import in the ts file to match the [released version](https://github.com/zammad/zammad/blob/6.3.1/app/frontend/apps/mobile/components/Form/fields/FieldFile/FieldFileInput.vue#L7)

So tl;dr: remove your node_packages and you should be fine.

Thanks for investigating and the hint! Following fixed it for me without any other errors:

rm -rf /opt/zammad/node_modules/
zammad run yarn cache clean
zammad run rake vite:clobber
zammad run rake assets:precompile

/closed