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 when building with Nuxt 3 #150

Open
lucassimines opened this issue Sep 6, 2022 · 2 comments
Open

Error when building with Nuxt 3 #150

lucassimines opened this issue Sep 6, 2022 · 2 comments

Comments

@lucassimines
Copy link

Describe the bug
A clear and concise description of what the bug is.

 ERROR  [nuxt] [request error] [unhandled] [500] Named export 'MarkerClusterer' not found. The requested module 'file:///Users/lucassimines/FMCX/FMCX%20Dashboard/fmcx-one/node_modules/@googlemaps/markerclusterer/dist/index.umd.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'file:///Users/lucassimines/FMCX/FMCX%20Dashboard/fmcx-one/node_modules/@googlemaps/markerclusterer/dist/index.umd.js';
const { MarkerClusterer } = pkg;

To Reproduce
Steps to reproduce the behavior:

  1. Setup Nuxt 3 app
  2. Create a vue-google-maps plugin
  3. Nuxt 3 npm run build

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Macos Monterrey
  • Browser: Chrome
  • Version: 104.0.5112.101

Additional context
Add any other context about the problem here.

@lucassimines
Copy link
Author

Solved this issue by adding @googlemaps/markerclusterer into nuxt.config.ts build:

build: {
    transpile: ['@fawmi/vue-google-maps', '@googlemaps/markerclusterer']
}

@rumblecat
Copy link

This also fixed the issue for us, thanks.

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