fabian-hiller / valibot

The modular and type safe schema library for validating structural data 🤖
https://valibot.dev
MIT License
6k stars 186 forks source link

Edge case bug with JSR version #662

Closed jasperteo closed 3 months ago

jasperteo commented 3 months ago

For the Valibot JSR version I have encountered an edge case where it doesnt work in Solid component with a (client:only="solid-js") directive inside Astro.

The error message will show: The requested module './types.js' does not provide an export named 'PartialCheckIssue'

file:///projectroot/node_modules/@valibot/valibot/src/actions/partialCheck/index.js:3
export { PartialCheckIssue } from "./types.js";
         ^^^^^^^^^^^^^^^^^
SyntaxError: The requested module './types.js' does not provide an export named 'PartialCheckIssue'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:171:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:254:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:475:24)
    at async nodeImport (file:///projectroot/node_modules/astro/node_modules/vite/dist/node/chunks/dep-h78lQ5BT.js:53493:15)
    at async ssrImport (file:///projectroot/node_modules/astro/node_modules/vite/dist/node/chunks/dep-h78lQ5BT.js:53349:16)
    at async eval (projectroot/components/importedValibotComponent.tsx:8:31)
    at async instantiateModule (file:///projectroot/node_modules/astro/node_modules/vite/dist/node/chunks/dep-h78lQ5BT.js:53408:5)

This does not happen on the NPM version of Valibot.

fabian-hiller commented 3 months ago

Thanks! Will publish a new version on JSR in the next minutes.