-
Notifications
You must be signed in to change notification settings - Fork 18
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
Orb tries to load worker file that doesn't exist [Angular] #94
Comments
Hi @frne, thanks for opening the issue. Someone from our team will pick this up and get back to you here. In the meantime, what are you trying to build with Orb? 😃 |
Thanks for taking care @antejavor |
I'm having the same issue building a graph editor with Vue. Seems to be pointing to a worker file in the local development server
|
@frne Did you correctly set up the worker script in In your project setup do you have a "architect": {
"build": {
...
"webWorkerTsConfig": "./path/to/tsconfig.worker.json",
... And set up the worker tsconfig file similar to this: /* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/worker",
"lib": [
"es2020",
"webworker"
],
"module": "es2020",
"types": ["node"],
"allowJs": true
},
"include": [
"../../node_modules/@memgraph/orb/**/*.worker.ts",
"../../node_modules/@memgraph/orb/**/*.worker.js"
]
} Otherwise Angular won't know what to do with |
Not too familiar with Vue, but maybe something similar should be set up regarding WebWorkers? |
@edanweis, the Vue problem is more an issue with the local development server failing to set the correct content type. Are you using Nuxt? I'm facing the same problem, but it only happens with the development server using nitrojs. If I do a proper build, then everything works as expected because the production server serves process.worker with content type "text/javascript". I can't for the life of me figure out how to instruct nitrojs/h3 to server that file with the correct content type. |
Fixing the tsconfig resolved it. Thank you @cizl |
Hi. I have same type of problem with Vite+React. Please, does anybody knows how to solve it? It is problem only when it runs live (dev). When I make build it works there correctly. |
@stefanak-michal have you had any success with this? I am unsure if we can add any improvements to the library itself. I saw you moved from Vite to Parcel where it is working ok: stefanak-michal/cyphergui#111 |
@tonilastre no success with Vite. Therefore the switch. It works as I needed with Parcel. |
Context
Using Orb in an Angular 17 component:
Problem
When constructing
new Orb
inngAfterViewInit()
, it tries to load a worker file using a GET call to the following URL:http://localhost:8990/@fs/home/boss/Projects/rapid-arch/frontend/.angular/cache/17.2.2/vite/deps/process.worker?type=module&worker_file
The following error occurs:
Question
It seems that Orb is trying to load a webworker or similar, but this URL doesn't exist (content of index.html is returned). Is it possible to preload the worker or supply it under a different path? Is there any configuration to change or deactivate this behavior? If not, can it be changed?
The text was updated successfully, but these errors were encountered: