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

throw Error under electron #123

Open
shaohaojiecoder opened this issue Nov 30, 2020 · 1 comment
Open

throw Error under electron #123

shaohaojiecoder opened this issue Nov 30, 2020 · 1 comment

Comments

@shaohaojiecoder
Copy link

shaohaojiecoder commented Nov 30, 2020

Hi, Brother:
it happend like under->
import vgl from 'vue-golden-layout' Vue.use(vgl)
it raised

Uncaught SyntaxError: Unexpected token .
at createScript (vm.js:80)
at Object.runInThisContext (vm.js:139)
at Module._compile (module.js:606)
at Object.Module._extensions..js (module.js:653)
at Module.load (module.js:561)
at tryModuleLoad (module.js:504)
at Function.Module._load (module.js:496)
at Module.require (module.js:586)
at require (internal/module.js:11)
at Object.golden-layout/src/css/goldenlayout-base.css

when I fix it like:
`/webpack.renderer.config.js/
...
let whiteListedModules = ['vue', 'vue-golden-layout']
...
...
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
})
...

/* main.js */
window.jQuery = window.$ = require('jquery/dist/jquery.min')
`
it still raise error but diffrent:

C:\Users\haojie.shao\Desktop\dfc-project\xdata-viewer\node_modules\vue\dist\vue.runtime.common.dev.js:621 [Vue warn]: Injection "layout" not found

found in

---> at gl-group.vue
at src/renderer/views/dashboard/index.vue
at src/renderer/App.vue

warn @ C:\Users\haojie.shao\Desktop\dfc-project\xdata-viewer\node_modules\vue\dist\vue.runtime.common.dev.js:621
C:\Users\haojie.shao\Desktop\dfc-project\xdata-viewer\node_modules\vue\dist\vue.runtime.common.dev.js:621 [Vue warn]: Injection "belongGroupColor" not found

found in

---> at gl-group.vue
at src/renderer/views/dashboard/index.vue
at src/renderer/App.vue

warn @ C:\Users\haojie.shao\Desktop\dfc-project\xdata-viewer\node_modules\vue\dist\vue.runtime.common.dev.js:621
2C:\Users\haojie.shao\Desktop\dfc-project\xdata-viewer\node_modules\vue-class-component\dist\vue-class-component.common.js:129 [vue-class-component] Component class must inherit Vue or its descendant class when class property is used.
warn @ C:\Users\haojie.shao\Desktop\dfc-project\xdata-viewer\node_modules\vue-class-component\dist\vue-class-component.common.js:129
C:\Users\haojie.shao\Desktop\dfc-project\xdata-viewer\node_modules\vue\dist\vue.runtime.common.dev.js:621 [Vue warn]: Error in created hook: "TypeError: Cannot read property 'addGlChild' of undefined"

found in

---> at gl-group.vue
at src/renderer/views/dashboard/index.vue
at src/renderer/App.vue

...
C:\Users\haojie.shao\Desktop\dfc-project\xdata-viewer\node_modules\golden-layout\dist\goldenlayout.js:458 Uncaught (in promise) Error: jQuery is missing as dependency for GoldenLayout. Please either expose $ on GoldenLayout's scope (e.g. window) or add "jquery" to your paths when using RequireJS/AMD
at new lm.LayoutManager (C:\Users\haojie.shao\Desktop\dfc-project\xdata-viewer\node_modules\golden-layout\dist\goldenlayout.js:458)
at VueComponent.eval (vue-golden-layout.js?22e2:908)
at step (vue-golden-layout.js?22e2:746)
at Object.eval [as next] (vue-golden-layout.js?22e2:727)
at eval (vue-golden-layout.js?22e2:721)
at new Promise ()
at ../node_modules/ts-loader/index.js?!../node_modules/vue-loader/lib/index.js?!../node_modules/source-map-loader/index.js!./golden.vue?vue&type=script&lang=ts&.__awaiter (vue-golden-layout.js?22e2:717)
at eval (vue-golden-layout.js?22e2:876)
at

Thanks very much!!!!!

@eddow
Copy link
Collaborator

eddow commented Dec 31, 2020

I didn't take time to create an electron project to make the test, but it seems to me the injection problem is due to a vgl component not to be in a <golden-layout ... element.
Take care that the golden-layout element surrounds every vue-golden-layout logic.

If you don't find, please provide a minimal example to reproduce the bug.

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