Open Kaishiyoku opened 1 month ago
I could isolate the issue. It occurs when I disable eager loading for import.meta.glob
imports. But that breaks Vite's chunking and results into a single app.js
file on production.
Update: it still doesn't work though. As soon as I'm using a local resolve function it breaks.
Quick update. I got it to work. The main issue was that I was using useModal
inside my modal component without any resolver. But I have to use the hook to be able to get the show
, hide
and redirect
variables. I also got it to work with import.meta.glob
without setting eager
to true
. That way a Promise is being returned and I had to adjust the useModal
hook accordingly. My fix is a little dirty though. I will try to deliver a better solution in a pull request soon if I don't forget :D
I used to use a global resolver which worked but it broke automatic module chunking when running
npm run build
(only oneapp.js
file got generated with over than 500kb of size). So I thought to use a local resolver like this:But when I visit a route with a modal I get this JavaScript error saying that there is no resolver function defined: