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

Issue with Service Worker Registration in Web App #16

Closed
daud99 opened this issue Oct 3, 2024 · 2 comments
Closed

Issue with Service Worker Registration in Web App #16

daud99 opened this issue Oct 3, 2024 · 2 comments
Assignees

Comments

@daud99
Copy link
Contributor

daud99 commented Oct 3, 2024

I'm an Outreachy applicant exploring the MolEvolvR package. I successfully ran the MolEvolvR package, and then I thought of checking its web app as well. I cloned the repository and followed the instructions, but I encountered the following error when I opened the web app in my browser:

`
getWorkerInstance.ts:85 Uncaught (in promise) Error: [MSW] Failed to register the Service Worker:

Failed to register a ServiceWorker for scope ('http://localhost:5713/') with script ('http://localhost:5713/mockServiceWorker.js'): The script has an unsupported MIME type ('text/html').
at getWorkerInstance (getWorkerInstance.ts:85:11)
at async startWorkerInstance (createStartHandler.ts:29:24)
at async SetupWorkerApi.start (setupWorker.ts:179:12)
at async main.tsx:14:5
`

I looked into the code and found that the mockServiceWorker.js file is included in the .gitignore file, so it's not part of the repository. After generating it, I was able to run the application successfully in the browser.

I have a couple of questions:

Shouldn't the mockServiceWorker.js file be included in the repository from the start, and why isn't it there?
Do we need to rerun the Docker command (./run_stack.sh) every time we make a change to the code? Can't we have something like hot reloading for the frontend?
I'm not sure if this is deliberate or if it's an issue, but if it is, I would be happy to help resolve it.

Thank you!

@jananiravi @vincerubinetti

@vincerubinetti
Copy link
Collaborator

This is correct, good catch. The script is supposed to be committed into the repository.

Feel free to submit a PR to fix.

@daud99
Copy link
Contributor Author

daud99 commented Oct 3, 2024

@vincerubinetti Okay I'm on it.

Thanks

daud99 pushed a commit to daud99/molevolvr2.0 that referenced this issue Oct 3, 2024
1. .gitignore updated
2. mockServiceWorker.js added
vincerubinetti pushed a commit that referenced this issue Oct 3, 2024
Fixing the #16 

1- .gitignore updated
2- mockServiceWorker.js added

Co-authored-by: Daud Ahmed <daudahmed870@gmail.com>
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