Comments (3)
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.
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
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.
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)
- OnChange (handleChange func) HOT 2
- Add support for Form Arrays for Helper Components
- $errors first string, then array HOT 1
- Prototype Pollution
- Document best practices for handling form submission
- View 'global' error on validationSchema's yup object
- Validation with nested objects behaves inconsistently HOT 1
- Is this project maintained? HOT 1
- Export FormState type
- Adding useField() functionality HOT 1
- Where can I find the documentation for v2? HOT 1
- $errors is not returning error messages for simple arrays (yup.array(yup.string().require()) HOT 1
- set errors when using helpers HOT 1
- What is the correct way to update a property in touched store that is array of objects?
- Have form.reset() HOT 2
- Manually modify initialValues HOT 1
- Add alternatives to validationSchema HOT 1
- Vite Warning: Svelte field in package.json but no export condition for svelte. HOT 1
- onSubmit Function Behaves Inappropriate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-forms-lib.