@jorgeuos opened this Issue on May 11th 2022

Hi,

Files won't compile for production use.

Expected Behavior

Files should compile for production.

Current Behavior

I get an issue when running ./console vue:build SimpleVue.

Full output:

$ ./console vue:build SimpleVue
Building SimpleVue...
 ERROR  Build failed with errors.
Failed:
 ERROR  Failed to compile with 3 errors2:43:57 PM
 error  in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/index.ts
[tsl] ERROR in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/index.ts(9,10)
      TS2305: Module '"./SimpleVueComponent/SimpleVueComponent.vue"' has no exported member 'default'.
 error  in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.adapter.ts
[tsl] ERROR in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.adapter.ts(9,40)
      TS2307: Cannot find module 'CoreHome' or its corresponding type declarations.
 error  in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.vue.ts
[tsl] ERROR in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.vue.ts(3,22)
      TS7006: Parameter 'n' implicitly has an 'any' type.
 ERROR  Failed to compile with 3 errors2:43:58 PM
 error  in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/index.ts
[tsl] ERROR in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/index.ts(9,10)
      TS2305: Module '"./SimpleVueComponent/SimpleVueComponent.vue"' has no exported member 'default'.
 error  in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.adapter.ts
[tsl] ERROR in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.adapter.ts(9,40)
      TS2307: Cannot find module 'CoreHome' or its corresponding type declarations.
 error  in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.vue.ts
[tsl] ERROR in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.vue.ts(3,22)
      TS7006: Parameter 'n' implicitly has an 'any' type.
 ERROR  Failed to compile with 3 errors2:43:58 PM
 error  in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/index.ts
[tsl] ERROR in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/index.ts(9,10)
      TS2305: Module '"./SimpleVueComponent/SimpleVueComponent.vue"' has no exported member 'default'.
 error  in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.adapter.ts
[tsl] ERROR in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.adapter.ts(9,40)
      TS2307: Cannot find module 'CoreHome' or its corresponding type declarations.
 error  in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.vue.ts
[tsl] ERROR in /usr/local/var/www/matomo/plugins/SimpleVue/vue/src/SimpleVueComponent/SimpleVueComponent.vue.ts(3,22)
      TS7006: Parameter 'n' implicitly has an 'any' type.

It works fine when running with the --watch option.

./console vue:build SimpleVue --watch

таз  Building for development as library (commonjs,umd,umd-min)... DONE  Compiled successfully in 4939ms2:49:16 PM

 DONE  Compiled successfully in 4984ms2:49:17 PM

 DONE  Compiled successfully in 5019ms2:49:17 PM

  File                                      Size             Gzipped

  plugins/SimpleVue/vue/dist/SimpleVue.d    50.06 KiB        7.86 KiB
  evelopment.umd.min.js
  plugins/SimpleVue/vue/dist/SimpleVue.d    50.06 KiB        7.86 KiB
  evelopment.umd.js
  plugins/SimpleVue/vue/dist/SimpleVue.d    49.47 KiB        7.68 KiB
  evelopment.common.js

  Images and other types of assets omitted.

No issues found.
No issues found.
No issues found.

Success

"Screenshot-1"

Nagging TS Intellisense

Also my editor is always nagging about the:

Cannot find module 'CoreHome' or its corresponding type declarations.ts(2307)

"Screenshot-2"

The only issue in the logs, which I get all the time, so it should be unrelated.

***
Severity: WARNING
Tag: TrackerDomain
Datetime: 2022-05-11 12:23:37 UTC
Request id: a3613
Message: /usr/local/var/www/matomo/plugins/TrackerDomain/TrackerDomain.php(106): Warning - Undefined array key "url" - Matomo 4.8.0
***

Possible Solution

I don't want to tamper with files from the original Matomo repo, because I might jump between computers, environments or other settings, so it would be nice to have it fixed properly instead of having to apply a patch every time I need to compile the files.

But my gut feeling says to look into:

tsconfig.json
tsconfig.spec.json
vue.config.json

I've tried installing npm every way possible, I even tried with yarn.

Steps to Reproduce (for Bugs)

I added a repo with a SimpleVue plugin. With how to reproduce the errors.

Context

  • Can't ship plugins to production.
  • Get more help and help the Matomo community.
  • No relevant discussions that I can find.

Your Environment

  • Matomo Version: 4.7.1 - 4.8.0
  • PHP Version: 7.4-8.0
  • Server Operating System: Mac locally and Linux on prod, but mostly docker images.
  • Additionally installed plugins: From clean install.

Br, Jorge

@sgiehl commented on May 15th 2022 Member

@diosmosis are you able to help here?

@diosmosis commented on May 15th 2022 Member

@jorgeuos can you run ./console vue:build CoreHome? The types for that plugin need to be built first. (Note: you can see this from the TypeScript errors.)

@jorgeuos commented on June 1st 2022

Oh, sorry. Missed your reply. I'm on parental leave... again. Lemme check, I think I have an environment running locally.

@sgiehl commented on November 9th 2022 Member

Closing this one for now. @jorgeuos If you still have any issues, feel free to create a new issue or get in touch on our forum. Cheers

This Issue was closed on November 9th 2022
Powered by GitHub Issue Mirror