radix-vue / shadcn-vue

Vue port of shadcn-ui
https://www.shadcn-vue.com/
MIT License
4.57k stars 262 forks source link

[Bug]: Toast - Failed to load source map for @internationalized/date #545

Closed frenicohansen closed 4 months ago

frenicohansen commented 4 months ago

Reproduction

https://stackblitz.com/edit/vitejs-vite-ofaacw?file=app.vue

Describe the bug

If I use the Toast component following warnings showed up in my terminal.

Nuxt 3.11.2 with Nitro 2.9.6                                                                                                                14:28:36
                                                                                                                                            14:28:37
  ➜ Network:  https://stackblitz.com/edit/vitejs-vite-ofaacw [QR code]
  ➜ Local:    http://localhost:3000/

ℹ Using Tailwind CSS from ~/assets/css/tailwind.css                                                                       nuxt:tailwindcss 14:28:45
  ➜ DevTools: press Shift + Alt + D in the browser (v1.2.0)                                                                                 14:28:48

ℹ Tailwind Viewer: http://localhost:3000/_tailwind/                                                                       nuxt:tailwindcss 14:28:49
ℹ Compiled plugins/server.mjs in 935.34ms                                                                                                  14:28:51
ℹ Compiled types/plugins.d.ts in 937.91ms                                                                                                  14:28:51
ℹ Compiled plugins/client.mjs in 965.64ms                                                                                                  14:28:51
ℹ Vite client warmed up in 8355ms                                                                                                          14:29:02

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/CalendarDate.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/GregorianCalendar.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/JapaneseCalendar.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/BuddhistCalendar.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/TaiwanCalendar.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/PersianCalendar.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/IndianCalendar.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/IslamicCalendar.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/HebrewCalendar.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/EthiopicCalendar.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/createCalendar.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/conversion.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/queries.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/string.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/DateFormatter.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/manipulation.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/utils.mjs.map'

[14:29:09]  WARN  Failed to load source map for /home/projects/vitejs-vite-ofaacw/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
ENOENT: no such file or directory, open '/home/projects/vitejs-vite-ofaacw/node_modules/.pnpm/@internationalized+date@3.5.3/node_modules/@internationalized/date/dist/weekStartData.mjs.map'

ℹ Vite server warmed up in 15275ms                                                                                                         14:29:09
✔ Nuxt Nitro server built in 8058 ms       

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) x64 Intel(R) Core(TM) i7-8557U CPU @ 1.70GHz
    Memory: 167.13 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.6.1 - ~/.nvm/versions/node/v20.6.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v20.6.1/bin/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v20.6.1/bin/npm
    pnpm: 9.1.0 - ~/.nvm/versions/node/v20.6.1/bin/pnpm
  Browsers:
    Safari: 17.4.1

Contributes

frenicohansen commented 4 months ago

https://github.com/adobe/react-spectrum/pull/6368

vchan14 commented 4 months ago

had the same problem.

look like this package is used by radix-vue.

image
NeoPrint3D commented 4 months ago

I believe I've identified the issue. It seems that Nuxt is attempting to lazy load everything, so when the toaster or tooltip component is placed in the app.vue file, Nuxt is unable to resolve the toaster and as a result, it causes the missing map files."

IE. remove the or form the app.vue -> layout/default.vue or the page you are using the component

Edit: For whatever reason for me its the tooltip provider and not the toaster

vchan14 commented 4 months ago

I have problems with all the components. I've confirmed by starting a new project.

sukbearai commented 4 months ago

how to resolve?