Code Monkey home page Code Monkey logo

Comments (3)

matpen avatar matpen commented on June 21, 2024 1

Thank you for the pointer, @pateketrueke: this sounds like a plausible explanation. I failed to mention that I am actually using webpack, but since I am in the process of looking for a suitable solution, I will look for similar configuration, and report back here if I find a viable option. This may help others in the same situation.

from svelte-forms-lib.

matpen avatar matpen commented on June 21, 2024 1

I have performed some research, and I can confirm @pateketrueke's advice: in my case, using webpack 5 with svelte-loader, this is clearly documented, and I obviously missed it. For rollup (which I do not use) I found some references here.

svelte-forms-lib correctly provides the svelte entrypoint (main field), and my tests confirm that this solves the problem (using [email protected]).

More documentation about the mainFields settings can be found

  • for webpack 5, here;
  • for rollup, here.

To the maintainers of svelte-forms-lib: this solves the issue, which can probably be closed, although I advise to track sveltejs/svelte#6584. Thank you for the wonderful work on this library!

from svelte-forms-lib.

pateketrueke avatar pateketrueke commented on June 21, 2024

The issue is how your bundler resolves the svelte sources, as said on their documentation, they should read the .svelte sources and not the compiled ones.

In your sandbox, you can read something like this:

new Form
https://lke5ek.csb.app/node_modules/svelte-forms-lib/build/index.mjs:900:5

That's pointing out that we're not loading from the ./lib folder (which contains the .svelte sources) but from ./build so the problem is not svelte per-se, the settings of your bundler are responsible of that.

I would think that your sandbox (or may be your code/bundler/settings) are using the module option from any package.json being resolved, which, in this case actually points to "module": "./build/index.mjs" and such...

Check out the documentation fot the rollup's resolve plugin, and for the mainFields option.

I had this kind of issues before, but as soon I started to configure my bundler as expected (I use esbuild) then the issue gone.

from svelte-forms-lib.

Related Issues (20)

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.