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

Bug with using it in the newest version(s) of SvelteKit #29

Closed
jochemvogel opened this issue Jul 21, 2022 · 4 comments
Closed

Bug with using it in the newest version(s) of SvelteKit #29

jochemvogel opened this issue Jul 21, 2022 · 4 comments

Comments

@jochemvogel
Copy link

jochemvogel commented Jul 21, 2022

Probably because of this change: sveltejs/kit#5332 the following error will occur:

/node_modules/svelte-paginate/src/index.js:1
export { default as paginate } from './paginate.js'
^^^^^^

SyntaxError: Unexpected token 'export'
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:190:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:281:24)

Found a related issue: vitejs/vite#7130

Reinstalling did work on the first try, but after that still the same error.

Updating the package to ES Modules obviously doesn't fix the problem and will produce a Unknown file extension ".svelte" type error.

const { paginate, LightPaginationNav } = 'svelte-paginate'; wont' fix it neither.

svelte-paginate doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.
@jochemvogel jochemvogel changed the title FYI: bug with using it in the newest version(s) of SvelteKit Bug with using it in the newest version(s) of SvelteKit Jul 21, 2022
@jochemvogel
Copy link
Author

jochemvogel commented Jul 21, 2022

I'm not sure how to fix this (yet), but I think it's good that you're aware that with the newest version(s) of SvelteKit the package isn't working anymore. Am I right?

@bas-baskara
Copy link

Hi @jochemvogel,

I think you can solve the issue with this #23 (comment)

@jochemvogel
Copy link
Author

Updating the package to ES Modules obviously doesn't fix the problem and will produce a Unknown file extension ".svelte" type error.

Thanks for the suggestion @bas-baskara. But as I said: "Updating the package to ES Modules obviously doesn't fix the problem and will produce a Unknown file extension ".svelte" type error."

@TahaSh
Copy link
Owner

TahaSh commented Oct 31, 2022

It's fixed in v0.1.0.

@TahaSh TahaSh closed this as completed Oct 31, 2022
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