-
Notifications
You must be signed in to change notification settings - Fork 63
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
Unable to use Loader in production (Nuxt3) #692
Comments
Same issue on SvelteKit. Works in SvelteKit dev mode, but fails with the identical error when previewing production build. |
Hello. Has anyone managed to solve this problem yet? |
For SvelteKit you can add the following to your vite.config.js:
If you are using Astro, then that would go in your astro.config.mjs file under vite, e.g.:
Hope that helps ;) |
This was actually very helpful since I've been stuck on this issue for a little while. Thanks a lot! |
This might be related to nuxt/nuxt#14454 I was having issues with SSG as described in that issue but using the temporary workaround (as described in that issue), Google Maps has started mounting correctly in production builds. My map is not in the root |
This fixed the issue for me:
|
Attempts to import Loader fail when attempting to use it in a Nuxt3 app in production. This doesn't appear to be a Nuxt3 or Vite issue.
import { Loader } from '@googlemaps/js-api-loader'
Works fine in development but after building the app, I get the following error:
The above suggested solution doesn't work, however importing the entire library does but that's obviously not ideal.
Environment details
"@googlemaps/js-api-loader": "^1.14.3"
MacOS 12.6
Node v16.14.0
The text was updated successfully, but these errors were encountered: