Skip to content

export 'paginate' (imported as 'paginate') was not found in 'svelte-paginate' #38

@toadle

Description

@toadle

Hey there,

today I was trying to use svelte-paginate in my Golang-Buffalo-Project, which runs a webpacke-configuration of svelte using svelte-loader as described in the official documentation.

I run into a loading/resolving error that I cannot figure out. I do NOT use TypeScript:

WARNING in ./assets/js/components/SearchApp.svelte 498:39-47
export 'paginate' (imported as 'paginate') was not found in 'svelte-paginate' (possible exports: DarkPaginationNav, LightPaginationNav, PaginationNav)
 @ ./assets/js/search.js 1:0-54 2:16-25

I see more consequent(?) errors:

ERROR in ./node_modules/svelte-paginate/generateNavigationOptions.js 1:0-37
Module not found: Error: Can't resolve './types' in '/Users/tim/Workspace/wescale/wapiti/node_modules/svelte-paginate'
Did you mean 'types.js'?
BREAKING CHANGE: The request './types' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request

and the same for paginate after that:

ERROR in ./node_modules/svelte-paginate/index.js 1:0-38
Module not found: Error: Can't resolve './paginate' in '/Users/tim/Workspace/wescale/wapiti/node_modules/svelte-paginate'
Did you mean 'paginate.js'?
BREAKING CHANGE: The request './paginate' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

I use this to import svelte-paginate:

  import { paginate, LightPaginationNav } from 'svelte-paginate'
  ...

  let results = [];
  let currentPage = 1;
  let pageSize = 50;
  $: paginatedItems = paginate({ items: results, pageSize, currentPage })

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions