Giter Site home page Giter Site logo

Comments (8)

zhuganglie avatar zhuganglie commented on July 20, 2024 3

Same problem here.

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.

from svelte-paginate.

bas-baskara avatar bas-baskara commented on July 20, 2024 3

Same problem here.

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.

I solved this simply by adding "type":"module" in package.json of svelte-paginate in node_modules. I have made PR for this at #27

from svelte-paginate.

TahaSh avatar TahaSh commented on July 20, 2024 3

Fixed in v0.1.0.

from svelte-paginate.

w3rafu avatar w3rafu commented on July 20, 2024

True, still works.

from svelte-paginate.

danielcassiano avatar danielcassiano commented on July 20, 2024

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.

from svelte-paginate.

danielcassiano avatar danielcassiano commented on July 20, 2024

Make sense, @bas-baskara. It is just important to share that by doing this, we're globally changing the default behavior from ESModules to CommonJS.

from svelte-paginate.

jarmitage avatar jarmitage commented on July 20, 2024

@bas-baskara adding "type":"module" was helpful, thanks

I also had to add "svelte": "src/index.js" as well to address this error:

Unknown file extension ".svelte" for /repo/node_modules/svelte-paginate/src/PaginationNav.svelte
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".svelte" for /repo/node_modules/svelte-paginate/src/PaginationNav.svelte
    at new NodeError (node:internal/errors:372:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:76:11)
    at defaultGetFormat (node:internal/modules/esm/get_format:118:38)
    at defaultLoad (node:internal/modules/esm/load:21:20)
    at ESMLoader.load (node:internal/modules/esm/loader:407:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:326:22)
    at new ModuleJob (node:internal/modules/esm/module_job:66:26)
    at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:345:17)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:304:34)
    at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:82:21)

Based on this discussion JustinVoitel/svelte-hero-icons#18

If others also have this issue, maybe it can be added to your PR @bas-baskara.

from svelte-paginate.

bas-baskara avatar bas-baskara commented on July 20, 2024

@jarmitage Yes thank you, I added your suggestion and also typescript support into my PR because I need it in my project too.

from svelte-paginate.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.