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

@algolia_autocomplete-js: Error on import #1247

Open
bmccorm2 opened this issue May 1, 2024 · 0 comments
Open

@algolia_autocomplete-js: Error on import #1247

bmccorm2 opened this issue May 1, 2024 · 0 comments

Comments

@bmccorm2
Copy link

bmccorm2 commented May 1, 2024

Description

I have a new Svelte app and am getting an error with the module above.
The requested module '/[node_modules/.vite/deps/@algolia_autocomplete-js.js](https://github.com/algolia/autocomplete/issues/node_modules/.vite/deps/@algolia_autocomplete-js.js)?t=1714511055987&v=b1e5f853' does not provide an export named 'default' (at +page.svelte:2:10)

I don't have any code yet; i can't even import the package without the error being thrown.

page.svelte

<script lang="ts">
  import pkg from "@algolia/autocomplete-js";
  import algoliasearch from "algoliasearch/lite";
  import { onMount } from "svelte";
  import "@algolia/autocomplete-theme-classic";
  import { goto } from "$app/navigation";

  const { autocomplete, getAlgoliaResults } = pkg;
</script>

<div id="autocomplete">

package.json

{
  "name": "test",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "dev": "vite dev",
    "build": "vite build",
    "preview": "vite preview",
    "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
    "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
  },
  "devDependencies": {
    "@sveltejs/adapter-auto": "^3.2.0",
    "@sveltejs/kit": "^2.5.7",
    "@sveltejs/vite-plugin-svelte": "^3.1.0",
    "autoprefixer": "^10.4.19",
    "postcss": "^8.4.32",
    "postcss-load-config": "^5.0.3",
    "svelte": "^4.2.15",
    "svelte-check": "^3.7.0",
    "tailwindcss": "^3.4.3",
    "tslib": "^2.6.2",
    "typescript": "^5.4.5",
    "vite": "^5.2.10"
  },
  "type": "module",
  "dependencies": {
    "@algolia/autocomplete-js": "^1.17.0",
    "@algolia/autocomplete-theme-classic": "^1.17.0",
    "algoliasearch": "^4.23.3"
  }
}
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

1 participant