Closed mariusvigariu closed 1 year ago
I've got it working by using the source code directly: import { NightVision } from '~/vendors/night-vision/src/interface'
and adding this in my nuxt.config.ts
:
import { svelte } from '@sveltejs/vite-plugin-svelte'
import viteRawPlugin from './vendors/night-vision/vite/vite-raw-plugin'
export default defineNuxtConfig({
// ...
vite: {
plugins: [
svelte({ emitCss: false }),
viteRawPlugin({
fileRegex: /\.navy$/,
}),
],
},
})
Two things I've found: web workers are not yet supported in firefox (in dev mode only) and Metamask extension might interfere and should be disabled.
Describe the bug
I have a typescript nuxt test project to play with the nv library. I've created a test page which looks like:
For some reason I always get the error:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
Error occurs on line 25 above, on
new NightVision ...
The second pane shows blank.
I am wild guessing this has to do with nv sending the navyjs scripts to the webworker for compilation or is it me doing something wrong?
Reproduction
https://nightvision.dev/guide/built-in-indicators/RSI.html
Steps to reproduce
Javascript Framework
vue
Logs
No response
Validations