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 using use-query-params when running build with Astro and Netlify #277

Open
samaritanau opened this issue Sep 27, 2023 · 2 comments
Open

Comments

@samaritanau
Copy link

Hi, we are trying to use this in an astro site and when running npm run build we get the following error, any idea what might be causing that?

import { useQueryParam, StringParam, useQueryParams, withDefault, NumberParam, ArrayParam, BooleanParam } from 'use-query-params';

SyntaxError: Named export 'ArrayParam' not found. The requested module 'use-query-params' 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 'use-query-params';
const { useQueryParam, StringParam, useQueryParams, withDefault, NumberParam, ArrayParam, BooleanParam } = pkg;

@penx
Copy link

penx commented Feb 22, 2024

I have the same when using remix@2.7.2 and use-query-params@2.2.1

https://stackblitz.com/edit/remix-run-remix-1gqkvs

@Nic-S
Copy link

Nic-S commented Feb 26, 2024

i have same issue using vitest 1.3.0

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

3 participants