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

An error happening when webworkers are implemented on next js #1

Closed
muhammedfouzan opened this issue May 23, 2024 · 5 comments
Closed

Comments

@muhammedfouzan
Copy link

muhammedfouzan commented May 23, 2024

image

"@jbrowse/core": "^2.10.2",
"@jbrowse/react-linear-genome-view": "^2.10.1",
"next": "^14.0.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",

state = createViewState({
assembly: config?.assembly[0],
tracks: config?.tracks,
defaultSession: config?.defaultSession,
aggregateTextSearchAdapters: config?.aggregateTextSearchAdapters,
// configuration: config?.configuration,
configuration: {
rpc: {
defaultDriver: "WebWorkerRpcDriver",
},
},
makeWorkerInstance,

    hydrateFn: hydrateRoot,
    createRootFn: createRoot,
  });
@cmdcolin
Copy link
Collaborator

cmdcolin commented May 23, 2024

i updated our examples including nextjs to use webworkers lately here and didn't see the same error you are seeing. latest code at https://github.com/GMOD/jbrowse-react-linear-genome-view-nextjs-demo/tree/main

...i am familiar with that error in another context (export svg) but a fix was deployed for that GMOD/jbrowse-components#4136 and i even noted that this could be an issue that potentially could arise, however, in practice, i am not seeing it.

your code looks correct so either a) my demo is not correct and maybe is not using webworkers (i think it is though? console.logging appears to show it is!) or b) your webworker setup or nextjs version or jbrowse version could have something to do with it

if you can cross reference vs the example repo that would be great

@muhammedfouzan
Copy link
Author

muhammedfouzan commented May 23, 2024

It is a weird issue, I cloned your repo, updated its package.json and next config file with mine, and still your repo works, but the same does not work in mine.
I used the same jbrowse config and page component of your repo in mine.
image

what else could be the reason, its not the package.json or next.config.ts. since I tried those of mine in yours

@cmdcolin
Copy link
Collaborator

can you get exact versions of packages used with e.g. "yarn why @jbrowse/react-linear-genome-view", "yarn why next", "yarn why react"

@muhammedfouzan
Copy link
Author

=> Found "@jbrowse/react-linear-genome-view@2.11.1"
=> Found "react@18.3.1"
=> Found "next@14.2.3"

@muhammedfouzan
Copy link
Author

I tried installing all module with yarn, instead of npm and it fixed the issue for me. Weird though, I'm assuming it to be something to do with my package-lock.json

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