Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue build for production issue #19211

Closed
jorgeuos opened this issue May 11, 2022 · 4 comments
Closed

Vue build for production issue #19211

jorgeuos opened this issue May 11, 2022 · 4 comments
Labels
worksforme The issue cannot be reproduced and things work as intended.

Comments

@jorgeuos
Copy link

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

@jorgeuos jorgeuos added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label May 11, 2022
@Findus23 Findus23 added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label May 12, 2022
@sgiehl
Copy link
Member

sgiehl commented May 15, 2022

@diosmosis are you able to help here?

@diosmosis
Copy link
Member

diosmosis commented May 15, 2022

@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
Copy link
Author

jorgeuos commented Jun 1, 2022

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

@sgiehl
Copy link
Member

sgiehl commented Nov 9, 2022

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

@sgiehl sgiehl closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2022
@sgiehl sgiehl added worksforme The issue cannot be reproduced and things work as intended. and removed c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

4 participants