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

Error: Loading module ... disallowed MIME type (""). #39

Closed
drewmo opened this issue Apr 18, 2023 · 1 comment
Closed

Error: Loading module ... disallowed MIME type (""). #39

drewmo opened this issue Apr 18, 2023 · 1 comment

Comments

@drewmo
Copy link

drewmo commented Apr 18, 2023

In case anyone experiences the issue on page two of trying to capture a photo after first setting up the usePhotoGallery() hook and clicking the photo button for the first time. You may see the following in your console related to loading the pwa-camera-modal:

image

The way to resolve this issue is to go into your vite.config.ts and remove the section for the test and replace it with this:

//Remove:
test: {
    globals: true,
    environment: 'jsdom',
    setupFiles: './src/setupTests.ts',
  }

//Replace with:
optimizeDeps: {
    exclude: ['@ionic/pwa-elements/loader']
  }

Your config file should now look like this:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  optimizeDeps: {
    exclude: ['@ionic/pwa-elements/loader']
  }
})

This is a known issue in vite: vitejs/vite#12434
You may need to delete your node_modules folder and install again.

@jcesarmobile
Copy link
Member

this was fixed in pwa-elements

@jcesarmobile jcesarmobile closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2023
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