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

Using vue-i18n with class-based components #18

Closed
antoniogiroz opened this issue Jun 10, 2018 · 10 comments
Closed

Using vue-i18n with class-based components #18

antoniogiroz opened this issue Jun 10, 2018 · 10 comments

Comments

@antoniogiroz
Copy link

Hi!

I'm migrating my code to use typescript and class-based components, but I get below error in the console:

image

NOTE: This works in web mode as expected (yarn serve).

Here my repository with sample code https://github.com/algil/vue-ts (look at src/modules/core/components/app-bar.vue)

Any idea?
Thanks!

@nklayman
Copy link
Owner

I'm not exactly sure what is wrong. For now, just develop using yarn serve. In v1.0.0, this issue will almost definitely be fixed as I will no longer be using electron-webpack.

@antoniogiroz
Copy link
Author

Hi @nklayman! Cool!
Looking forward to next release.
Thanks!

@nklayman
Copy link
Owner

I just released the first v1.0.0 alpha! Go ahead and try it again with the new version and let me know if it works. Thanks.

@antoniogiroz
Copy link
Author

Hi!

I've upgrade to new version, but electron app is not shown.

This is my package.json:

{
  "name": "client-desktop",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "dev": "yarn serve",
    "test:unit": "vue-cli-service test:unit",
    "test:e2e": "vue-cli-service test:e2e",
    "build:electron": "vue-cli-service build:electron",
    "serve:electron": "vue-cli-service serve:electron"
  },
  "dependencies": {
    "lodash": "^4.17.10",
    "vue": "^2.5.16",
    "vue-class-component": "^6.2.0",
    "vue-i18n": "^7.8.0",
    "vue-property-decorator": "^6.1.0",
    "vue-router": "^3.0.1",
    "vuescroll": "^4.6.5",
    "vuex": "^3.0.1",
    "vuex-class": "^0.3.1"
  },
  "devDependencies": {
    "@types/jest": "^23.1.0",
    "@vue/cli-plugin-babel": "^3.0.0-rc.2",
    "@vue/cli-plugin-e2e-cypress": "^3.0.0-rc.2",
    "@vue/cli-plugin-typescript": "^3.0.0-rc.2",
    "@vue/cli-plugin-unit-jest": "^3.0.0-rc.2",
    "@vue/cli-service": "^3.0.0-rc.2",
    "@vue/test-utils": "^1.0.0-beta.19",
    "babel-core": "7.0.0-bridge.0",
    "electron": "^2.0.2",
    "node-sass": "^4.9.0",
    "sass-loader": "^7.0.3",
    "ts-jest": "^22.4.6",
    "vue-cli-plugin-electron-builder": "^1.0.0-alpha.1",
    "vue-template-compiler": "^2.5.16"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ],
  "build": {
    "directories": {
      "output": "dist_electron"
    },
    "files": [
      "dist/**/*",
      "node_modules/**/*",
      "package.json"
    ]
  },
  "main": "dist_electron/bundled/background.js"
}

My project structure:

image

Any idea?
Thanks!

@nklayman
Copy link
Owner

I'm not sure what you mean by "electron app is not shown". Can you clarify please? What happens when you run build/serve:electron?

@nklayman
Copy link
Owner

also make sure to delete the build key in your package.json.

@antoniogiroz
Copy link
Author

antoniogiroz commented Jun 17, 2018

I mean the app (window) is not opened:

image

I've removed build config in package.json as well

@nklayman
Copy link
Owner

I created issue #24 for the serve:electron issue as someone else reported the same issue.

@nklayman
Copy link
Owner

I cloned your app, upgraded to vue-cli-plugin-electron-builder 1.0.0-alpha.2, and serve:electron worked just fine. try running yarn electron ./dist_electron/background.js while serve:electron is running (and has finished compiling).

@nklayman
Copy link
Owner

Since it worked just fine with no errors when I tried it, I will close this issue and continue to look into #24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants