kobaltedev / kobalte

A UI toolkit for building accessible web apps and design systems with SolidJS.
https://kobalte.dev
MIT License
1.2k stars 61 forks source link

Console warnings with Vite with newest Kobalte version #406

Closed gBasil closed 3 months ago

gBasil commented 3 months ago

Describe the bug After upgrading Kobalte, running Vite and visiting the Vite dev page prints a lot of errors in the Vite process' console about sourcemap errors with the @internationalized/date package (see the Screenshots section).

To Reproduce Steps to reproduce the behavior:

Example repo: https://github.com/gBasil/kobalte-source-map-error

  1. Clone repo
  2. Install packages
  3. Run the dev script.
  4. Go to the URL in the browser
  5. See the errors printed out in the Vite process.

Expected behavior

There should not be errors in the console.

Screenshots

9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/CalendarDate.mjs.
Error: An error occurred while trying to read the map file at CalendarDate.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/CalendarDate.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/BuddhistCalendar.mjs.
Error: An error occurred while trying to read the map file at BuddhistCalendar.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/BuddhistCalendar.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/TaiwanCalendar.mjs.
Error: An error occurred while trying to read the map file at TaiwanCalendar.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/TaiwanCalendar.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/PersianCalendar.mjs.
Error: An error occurred while trying to read the map file at PersianCalendar.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/PersianCalendar.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/IndianCalendar.mjs.
Error: An error occurred while trying to read the map file at IndianCalendar.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/IndianCalendar.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/GregorianCalendar.mjs.
Error: An error occurred while trying to read the map file at GregorianCalendar.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/GregorianCalendar.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/JapaneseCalendar.mjs.
Error: An error occurred while trying to read the map file at JapaneseCalendar.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/JapaneseCalendar.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/createCalendar.mjs.
Error: An error occurred while trying to read the map file at createCalendar.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/createCalendar.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/EthiopicCalendar.mjs.
Error: An error occurred while trying to read the map file at EthiopicCalendar.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/EthiopicCalendar.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/IslamicCalendar.mjs.
Error: An error occurred while trying to read the map file at IslamicCalendar.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/IslamicCalendar.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/conversion.mjs.
Error: An error occurred while trying to read the map file at conversion.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/conversion.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/string.mjs.
Error: An error occurred while trying to read the map file at string.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/string.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/HebrewCalendar.mjs.
Error: An error occurred while trying to read the map file at HebrewCalendar.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/HebrewCalendar.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/DateFormatter.mjs.
Error: An error occurred while trying to read the map file at DateFormatter.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/DateFormatter.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/queries.mjs.
Error: An error occurred while trying to read the map file at queries.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/queries.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+number@3.5.2/node_modules/@internationalized/number/dist/NumberFormatter.mjs.
Error: An error occurred while trying to read the map file at NumberFormatter.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+number@3.5.2/node_modules/@internationalized/number/dist/NumberFormatter.mjs.map'
9:01:26 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+number@3.5.2/node_modules/@internationalized/number/dist/NumberParser.mjs.
Error: An error occurred while trying to read the map file at NumberParser.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+number@3.5.2/node_modules/@internationalized/number/dist/NumberParser.mjs.map'
9:01:27 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/manipulation.mjs.
Error: An error occurred while trying to read the map file at manipulation.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/manipulation.mjs.map'
9:01:27 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/utils.mjs.
Error: An error occurred while trying to read the map file at utils.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/utils.mjs.map'
9:01:27 PM [vite] Failed to load source map for /Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/weekStartData.mjs.
Error: An error occurred while trying to read the map file at weekStartData.mjs.map
Error: ENOENT: no such file or directory, open '/Path/to/kobalte-test/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/weekStartData.mjs.map'

Desktop (please complete the following information):

oedotme commented 3 months ago

I've also opened an issue at https://github.com/adobe/react-spectrum/issues/6367

jer3m01 commented 3 months ago

Looks like an issue from @internationalized/date@3.5.3, you can pin the dependency to version 3.5.2 or wait for the fix https://github.com/adobe/react-spectrum/pull/6368 (thanks to @oedotme!)

widcardw commented 3 months ago

Same problem with @internationalized/number. I've changed it to 3.5.1 and the warnings may disappear.

gBasil commented 2 months ago

@jer3m01 Shouldn't this issue remain open until:

  1. A version of react-spectrum with the fix is released.
  2. The version Kobalte depends on is updated.
  3. A new version of Kobalte with the updated dependency is published.
jer3m01 commented 2 months ago

This is an issue from @internationalized/* not Kobalte.

Kobalte doesn't depend on the broken version (3.5.3) and targets:

"@internationalized/date": "^3.4.0",
"@internationalized/number": "^3.2.1",

This will automatically target the latest available version (of 3.x.x). Up to them to fix their release or users to pin the dependency.