-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delete
operator not working as excepted
#6747
Comments
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: nuxt/ui#809 (comment) // 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) |
Are you using the |
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 tailwindlabs/tailwindcss#4690 (comment)
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.
The text was updated successfully, but these errors were encountered: