Electron js error - file not found - debugging

I have a electron app, so in my dashboard page i am getting an error look like this
Error: Unhandled "error" event.(File not found)
I am using tradingview widget.
var widget = new TradingView.widget({
// debug: true, // uncomment this line to see Library errors and warnings in the console
fullscreen: true,
symbol: 'AA',
interval: 'D',
container_id: "tv_chart_container",
// BEWARE: no trailing slash is expected in feed URL
datafeed: new Datafeeds.UDFCompatibleDatafeed("http://abc.loc/api"),
library_path: "../../assets/charting_library/",
locale: "en",
// Regression Trend-related functionality is not implemented yet, so it's hidden for a while
drawings_access: { type: 'black', tools: [ { name: "Regression Trend" } ] },
disabled_features: ["use_localstorage_for_settings"],
enabled_features: ["study_templates"],
charts_storage_url: 'http://saveload.tradingview.com',
charts_storage_api_version: "1.1",
client_id: 'tradingview.com',
user_id: 'public_user_id'
});
How can I get the file name which can not be found. Thanks!

Related

Unit testing documentation for Vuetify is not compatible with latest release of #vue/test-utils. I need help setting up vitest

I've learned that createLocalVue no longer exists in Vue test utils, making this documentation outdated.
Here are the specs for my project:
Laravel 9 (w/ Vite)
Vue 3
Inertia.js
JavaScript
Vuetify 3
Testing
Vitest
Vue Test Utils
Here is what my vite.config.js looks like.
import {defineConfig} from 'vite';
import laravel from 'laravel-vite-plugin';
import DefineOptions from 'unplugin-vue-define-options/vite'
import vue from '#vitejs/plugin-vue';
import vuetify from 'vite-plugin-vuetify'
export default defineConfig({
build: {
sourcemap: true,
},
test: {
globals: true,
environment: 'jsdom',
deps: {
inline: ["vuetify"],
},
},
plugins: [
laravel({
input: [
'resources/js/app.js'
],
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
// The Vue plugin will re-write asset URLs, when referenced
// in Single File Components, to point to the Laravel web
// server. Setting this to `null` allows the Laravel plugin
// to instead re-write asset URLs to point to the Vite
// server instead.
base: null,
// The Vue plugin will parse absolute URLs and treat them
// as absolute paths to files on disk. Setting this to
// `false` will leave absolute URLs un-touched so they can
// reference assets in the public directory as expected.
includeAbsolute: false,
},
},
}),
vuetify({
autoImport: true
}),
DefineOptions(),
],
});
And here is the sample code for one of my tests.
import {describe, expect, test} from 'vitest';
import Home from "../Pages/Home.vue";
import {mount} from '#vue/test-utils'
describe('Home.vue', () => {
test("invoice pagination", () => {
const wrapper = mount(Home, {
props: {
invoicePagination: {
total: 0,
per_page: 5,
current_page: 1,
last_page: 1,
first_page_url: "https://127.0.0.1:8000/invoices?page=1",
last_page_url: "https://127.0.0.1:8000/invoices?page=1",
prev_page_url: null,
next_page_url: null,
path: "http://127.0.0.1:8000/invoices",
from: 1,
to: 1,
data: [],
}
},
});
expect(2 + 2 === 4);
})
})
I get this output in the terminal when running vitest.
[Vue warn]: injection "Symbol(vuetify:display)" not found.
at <Home invoicePagination= {
total: 0,
per_page: 5,
current_page: 1,
last_page: 1,
first_page_url: 'https://127.0.0.1:8000/invoices?page=1',
last_page_url: 'https://127.0.0.1:8000/invoices?page=1',
prev_page_url: null,
next_page_url: null,
path: 'http://127.0.0.1:8000/invoices',
from: 1,
to: 1,
data: []
} ref="VTU_COMPONENT" >
at <VTUROOT>
[Vue warn]: Invalid vnode type when creating vnode: undefined.
at <Home invoicePagination= {
total: 0,
per_page: 5,
current_page: 1,
last_page: 1,
first_page_url: 'https://127.0.0.1:8000/invoices?page=1',
last_page_url: 'https://127.0.0.1:8000/invoices?page=1',
prev_page_url: null,
next_page_url: null,
path: 'http://127.0.0.1:8000/invoices',
from: 1,
to: 1,
data: []
} ref="VTU_COMPONENT" >
at <VTUROOT>
❯ resources/js/Tests/Home.spec.js (1)
❯ Home.vue (1)
× invoice pagination
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL resources/js/Tests/Home.spec.js > Home.vue > invoice pagination
TypeError: Cannot read properties of undefined (reading 'total')
❯ Proxy._sfc_render resources/js/Pages/Home.vue:61:54
59| </v-col>
60| </v-row>
61| <v-row id="empty-result" v-if="invoicePagination.total === 0">
| ^
62| <v-col>
63| <NoInvoicesPicture v-if="!smAndDown"></NoInvoicesPicture>
❯ renderComponentRoot node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:891:44
❯ ReactiveEffect.componentUpdateFn [as fn] node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5570:57
❯ ReactiveEffect.run node_modules/#vue/reactivity/dist/reactivity.cjs.js:191:25
❯ instance.update node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5684:56
❯ setupRenderEffect node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5698:9
❯ mountComponent node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5480:9
❯ processComponent node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5438:17
❯ patch node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5042:21
❯ ReactiveEffect.componentUpdateFn [as fn] node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5577:21
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
Test Files 1 failed (1)
Tests 1 failed (1)
Start at 09:26:11
Duration 4.12s (transform 2.03s, setup 0ms, collect 2.37s, tests 34ms)
FAIL Tests failed. Watching for file changes...
press h to show help, press q to quit
I'm concerned about "injection "Symbol(vuetify:display)" not found." I believe it's causing my test to fail.
Without accurate docs, I don't know how to employ Vuetify with my configuration.

VSCode opens in wrong folder and adds cd to path

I recently installed vscode and when I run code . from the terminal it opens in the wrong folder, normally 2 folders up from where I am in the terminal and it also opens a new file called cd everytime it is opened in this way.
I started it in verbose mode and the pathsToOpen looks odd as it has the cd appended to the end of the path:
windowsManager#open pathsToOpen [
{
fileUri: h {
scheme: 'file',
authority: '',
path: '/Applications/Visual Studio Code.app/Contents/cd',
query: '',
fragment: '',
_formatted: null,
_fsPath: null
},
type: 1,
exists: false
},
{
workspace: { id: '3db690dfbc8707bfabc4d88e8b93f152', uri: [h] },
type: 2,
exists: true
}
]
[main 2022-06-29T12:58:36.049Z] windowsManager#doOpenFolderOrWorkspace {
folderOrWorkspace: {
workspace: { id: '3db690dfbc8707bfabc4d88e8b93f152', uri: [h] },
type: 2,
exists: true
},
filesToOpen: {
filesToOpenOrCreate: [ [Object] ],
filesToDiff: [],
remoteAuthority: undefined
}
}
I am not sure what can be causing this, looking on google hasnt helped me, the vscode github suggests asking questions here so hopefully I can get to the bottom of this.

Laravel Vue.js integration with CKeditor 4 and CKFinder3 (file manager)

I have some problems with integration CKeditor 4 and CKFinder 3 in My Laravel Vue app.
I just want the functionality when I click on "image button" in my Ckeditor - CKFinder window appears and I'm able to upload all needed images.
What problems I have? (a few, but they must be related with each other):
I have that error in my devtools console: "[CKEDITOR] Error code: cloudservices-no-token-url." (I'm supposing that issue must be resolved when I properly integrate CKeditor with CKFinder)
(as WARN in devtools) - " [CKEDITOR] Error code: editor-plugin-conflict. {plugin: "image", replacedWith: "easyimage"} "
"Image Button" in my CKeditor disappeared (ckeck screenshot below):
You can see my Vue component code with config for ckeditor:
...
export default {
components: { VueCkeditor },
data() {
return {
content: '',
config: {
toolbar: [
{ name: 'styles', items : [ 'Styles','Format', 'FontSize' ] },
{ name: 'clipboard', items : ['Undo','Redo' ] },
{ name: 'editing', items : [ 'Scayt' ] },
{ name: 'insert', items : [ 'Image','Table','HorizontalRule','SpecialChar','Iframe' ] },
{ name: 'tools', items : [ 'Maximize' ] },
'/',
{ name: 'basicstyles', items : [ 'Bold','Italic','Strike','RemoveFormat' ] },
{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ] },
{ name: 'links', items : [ 'Link','Unlink','Anchor' ] },
],
height: 400,
extraPlugins: 'autogrow,uploadimage',
filebrowserBrowseUrl: '/filemanager_storage?type=Files',
filebrowserUploadUrl: '/filemanager_storage/upload?type=Files&_token='+window.Laravel.csrfToken,
},
};
},
...
Other details which may be useful:
I use CKFinder 3 Package for Laravel 5.5+ (https://github.com/ckfinder/ckfinder-laravel-package)
In my ckfinder.php (configurations for CKFinder) I set temporally that code:
$config['authentication'] = function () {
return true;
};
I'm not sure in that paths (in my config object in vue):
filebrowserBrowseUrl: '/filemanager_storage?type=Files',
filebrowserUploadUrl: '/filemanager_storage/upload?type=Files&_token='+window.Laravel.csrfToken,
},
*I created 'filemanager_storage' directory in my 'public' directory
Thanks guys a lot for any help!
I was facing similar issues regarding a ckeditor4.x integration I did recently in an opencart site with php. While it's not the same environment with vue, maybe this could prove useful to you.
Instead of using the easyimage plugin for managing the image upload , I replaced it with the image2 (enhanced image plugin) . After you've downloaded the image2 plugin and placed it under the ckeditor4/plugins/ directory, make sure to add this in your ckeditor instance:
extraPlugins : 'image2',
removePlugins: 'easyimage,cloudservices'
Regarding the urls in the ckeditor instance, while I'm not using the filebrowserBrowseUrl , I've declared the filebrowserUploadUrl as such :
filebrowserUploadUrl: '/path_where_ckfinder_is_installed/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json
While in my case it made the image upload possible, I'm still getting the warning [CKEDITOR] Error code: editor-plugin-conflict. {plugin: "image", replacedWith: "image2"} " This is something that I haven't been able to solve yet, but at least the image upload works in my case with no fuss.
Also, make sure in the config.php of ckfinder that you've declared the BaseUrl and root path for the user files directory, i.e
$config['backends'][] = array(
'name' => 'default',
'adapter' => 'local',
'baseUrl' => $your_file_path,
'root' => '/your_root_dir/' . $your_file_path, // Can be used to explicitly set the CKFinder user files directory.
'chmodFiles' => 0777,
'chmodFolders' => 0755,
'filesystemEncoding' => 'UTF-8'
);
Let me know if this solution suits your case.

Error `Uncaught TypeError: t.addEventListener is not a function` integrating PhotoEditorSDK inside react-dom.js

On attempting to integrate PhotoEditorSDK into an angular app for the first time, I'm seeing this error in the console.
My config is:
const container = document.getElementById('editor');
const editor = new $window.PhotoEditorSDK.UI.DesktopUI({
container: container,
license: '{ .. }',
assets: {
baseUrl: '/js/pesdk/assets' // <-- This should be the absolute path to your `assets` directory
},
editor: {
image: 'https://www.photoeditorsdk.com/assets/images/new/landingpage/platform_html5-4c8765e5.png',
},
style: {
width: 500,
height: 500,
},
});
The editor begins to load, the license call completes successfully, then I see:
react-dom.production.min.js:162 TypeError: t.addEventListener is not a function
at e._loadSource (PhotoEditorSDK.js:6)
at new e (PhotoEditorSDK.js:6)
at e.setImage (PhotoEditorSDK.js:73)
at e._setImage (PhotoEditorSDK.UI.DesktopUI.js:14)
at c (PhotoEditorSDK.UI.DesktopUI.js:14)
at e.setImage (PhotoEditorSDK.UI.DesktopUI.js:14)
at e.componentDidMount (PhotoEditorSDK.UI.DesktopUI.js:27)
at commitLifeCycles (react-dom.production.min.js:148)
at b (react-dom.production.min.js:156)
at t (react-dom.production.min.js:167)
The non-minified "development" react-dom file looks minified also, so this is a pain to debug.
Right now the image option must be an actual image object, not a string URL, that's the source of the error. So you need to first load the image, pass is it as an option and load the editor.
There is an angular demo project if you'd like to checkout:
https://github.com/imgly/pesdk-angular-demo

How to setup a multipage project with fuse-box?

I'm not able to import files in my fusebox project and keep seeing the following error:
GET http://localhost:4444/hello.ts 404 (Not Found)
I've set my import statements correctly and don't understand what's causing the error. My project structure looks like this:
The config file:
Sparky.task("config", () => {
fuse = FuseBox.init({
homeDir: "src",
output: "dist/$name.js",
hash: isProduction,
sourceMaps: !isProduction,
plugins: [
[SassPlugin(), CSSPlugin()],
CSSPlugin(),
WebIndexPlugin({
target: "index.html",
template: "src/index.html"
}),
WebIndexPlugin({
target: "login.html",
template: "src/login.html"
}),
isProduction && UglifyJSPlugin()
],
});
// vendor should come first
vendor = fuse.bundle("vendor")
.instructions("~ js/indexView.ts");
// out main bundle
app = fuse.bundle("app")
.instructions(`!> js/indexView.ts`);
if (!isProduction) {
fuse.dev();
}
});
Hello.ts:
export function hello(name: string) {
return `Hello ${name}`;
}
IndexView.ts:
import {hello} from "./hello.ts";
const message: string = `This is the index page`;
console.log(hello(message));
You can also find this project here on Github.

Resources