GMOD / jbrowse-components

Source code for JBrowse 2, a modern React-based genome browser
https://jbrowse.org/jb2
Apache License 2.0
206 stars 62 forks source link

The development environment is normal, but there is an error in Feature details after building(Vite) #4387

Closed yukaiquan closed 4 months ago

yukaiquan commented 5 months ago

image

I got this error from JBrowse, here is the stack trace:

Error loading source map, showing raw stack trace below:
Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

    at yh$1 (http://www.waooat.cn/assets/index.8585207c.js:32:55673)
    at nv (http://www.waooat.cn/assets/index.8585207c.js:30:16191)
    at sv (http://www.waooat.cn/assets/index.8585207c.js:30:17829)
    at uv (http://www.waooat.cn/assets/index.8585207c.js:30:20297)
    at Yi$1 (http://www.waooat.cn/assets/index.8585207c.js:32:1684)
    at Wk (http://www.waooat.cn/assets/index.8585207c.js:32:51555)
    at Vk (http://www.waooat.cn/assets/index.8585207c.js:32:44693)
    at Uk (http://www.waooat.cn/assets/index.8585207c.js:32:44614)
    at Jk (http://www.waooat.cn/assets/index.8585207c.js:32:44455)
    at Ok (http://www.waooat.cn/assets/index.8585207c.js:32:40331)
yukaiquan commented 5 months ago
"@fontsource/roboto": "^4.5.8",
"@jbrowse/core": "^2.1.5",
"@jbrowse/react-linear-genome-view": "^2.1.5",
cmdcolin commented 5 months ago

do you have an git repo that demonstrates this bug perhaps? or a link to live instance?

we test using vite and I didn't see this issue as far as i can tell https://jbrowse.org/demos/lgv-vite/

cmdcolin commented 5 months ago

wondering if it is something about your particular data file potentially...

cmdcolin commented 5 months ago

@yukaiquan any update? if you can share the file you used it may help. can email it to colin.diesh@gmail.com

cmdcolin commented 5 months ago

@yukaiquan I did some investigating on your production server at http://www.waooat.cn/jbrowse/3/ and i noticed that the "About track" dialog also produced the error

It is very hard to understand the production minified errors though without a source map, so if you can build your app with production source maps, it may produce better error messages, see https://vitejs.dev/config/build-options#build-sourcemap

so in your vite.config.js, make it say e.g. something like

export default defineConfig({
  plugins: [react()],
  base: './',
  build: {
    sourcemap: true,
  }
})
yukaiquan commented 5 months ago

I apologize for the delayed response; I have been occupied with work in the experimental fields(oat). I appreciate your understanding and will give your method a try as soon as possible. Thank you very much!

yukaiquan commented 4 months ago

@yukaiquan I did some investigating on your production server at http://www.waooat.cn/jbrowse/3/ and i noticed that the "About track" dialog also produced the error

It is very hard to understand the production minified errors though without a source map, so if you can build your app with production source maps, it may produce better error messages, see https://vitejs.dev/config/build-options#build-sourcemap

so in your vite.config.js, make it say e.g. something like

export default defineConfig({
  plugins: [react()],
  base: './',
  build: {
    sourcemap: true,
  }
})

I've added the js.map file. Could you give it another check? Thanks a ton!

cmdcolin commented 4 months ago

I am suspecting that maybe this is related to this older issue we had https://github.com/gmod/jbrowse-components/issues/2896

it is the same thing related to the app crashing when the "About track" dialog is loaded

can you report what version of vite you are using? we created a workaround for older versions of vite, but then removed the workaround, so (my hypothesis at least is...) if you are using an older version of vite, it might be causing problems

yukaiquan commented 4 months ago

I am suspecting that maybe this is related to this older issue we had #2896

it is the same thing related to the app crashing when the "About track" dialog is loaded

can you report what version of vite you are using? we created a workaround for older versions of vite, but then removed the workaround, so (my hypothesis at least is...) if you are using an older version of vite, it might be causing problems

Fantastic, I updated Vite from version 3 to 5, the problem was fixed. Many thanks for that!

cmdcolin commented 4 months ago

excellent to hear:) let us know if you got any other issues. can maybe close for now