Open lnoss opened 1 year ago
i'm not sure if this could lead to more serious bugs than this, but it should still be looked into
any updates on this?
Please see the workaround here: https://github.com/nuxt/ui/issues/809#issuecomment-1921810965
// https://github.com/oven-sh/bun/issues/6747
import { createRequire } from 'node:module'
const _require = createRequire(import.meta.url)
const defaultColors = _require('tailwindcss/colors.js')
delete defaultColors.lightBlue
delete defaultColors.warmGray
delete defaultColors.trueGray
delete defaultColors.coolGray
delete defaultColors.blueGray
I tried to make a more minimal reproduction but it seems it can only happen in complex mixed CJS/ESM scenarios. (due to how it is an edge-case, probably would make sense we fix it in nuxt/ui workaround unless there are more reports without nuxt or nuxt/ui...)
any updates? seems to be the only remaining thing that behaves weirdly after going all-in on bun
Weirdly, I don't get this on my host (Bun 1.1.34, Arch Linux), but I do get it in the docker image oven/bun (also 1.1.34)
What version of Bun is running?
1.0.7
What platform is your computer?
Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
bun x nuxi init my-nuxt-app
bun add @nuxt/ui
(the module also installs @nuxtjs/tailwindcss and @nuxtjs/color-mode)nuxt.config.ts
at root project level, add:bun --bun run dev
) and compare it with Node runtime (bun run dev
)What is the expected behavior?
What do you see instead?
Additional information
See original post by @Daynil in https://github.com/tailwindlabs/tailwindcss/issues/4690#issuecomment-1046087220
NuxtUI delete these references and the solution works with Node, but not with Bun. Lines concerned: https://github.com/nuxt/ui/blob/4ce23746da27ad0ef9b1833e41105165045f1cb8/src/module.ts#L13#L17
I thought it was a problem of weak/strong references or more generally with garbage collector implementation, but @Jarred-Sumner thinks that the root cause is something linked to some property set to
readonly
and delete is not throwing an error maybe due to some sloppy mode thing. Or something is marked as enumerable (& vice versa).Fixing this issue should close nuxt/ui#809.