You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently our vite/nextjs examples are not enabled to do web worker rpc. It may be valuable to create examples of this but there are hurdles to each
For nextjs, the component tries to get rendered server side, and it gets confused by importing directly from '@jbrowse/react-linear-genome-view/esm/makeWorkerInstance' (which has esm export statement, which the server side does not like, it prefers the commonjs)
For vite, it gives a lot of odd errors related to MIME type. I found that adding the filename extension could help with this. Alternative code
At least for vite dev mode, haven't tried production, can get closer to working with this
const state = createViewState({
assembly,
tracks,
makeWorkerInstance: function makeWorkerInstance() {
return new Worker(
new URL(
"@jbrowse/react-linear-genome-view/esm/rpcWorker.js", // actual rpcWorker with file extension, has proper mime type
import.meta.url
),
{ type: "module" } // needed since it uses import
);
},
defaultSession,
configuration: {
rpc: {
defaultDriver: "WebWorkerRpcDriver",
},
},
});
The text was updated successfully, but these errors were encountered:
note that the above still goes into an infinite loading state on the tracks and maybe throws (err insufficiet resources? it loads a lot of js to the client...)
Currently our vite/nextjs examples are not enabled to do web worker rpc. It may be valuable to create examples of this but there are hurdles to each
For nextjs, the component tries to get rendered server side, and it gets confused by importing directly from '@jbrowse/react-linear-genome-view/esm/makeWorkerInstance' (which has esm export statement, which the server side does not like, it prefers the commonjs)
For vite, it gives a lot of odd errors related to MIME type. I found that adding the filename extension could help with this. Alternative code
At least for vite dev mode, haven't tried production, can get closer to working with this
The text was updated successfully, but these errors were encountered: