Skip to content

@algolia_autocomplete-js: Error on import #1247

Description

@bmccorm2

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"
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions