withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.71k stars 2.48k forks source link

Bun & Tailwind - Unexpected reading - node_modules/postcss-load-config/src/options.js #10880

Closed austinm911 closed 6 months ago

austinm911 commented 6 months ago

Astro Info

Astro                    v4.7.0
Node                     v20.12.2
System                   macOS (arm64)
Package Manager          bun
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
Bun 1.1.4

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Trying to get the tailwind integration to work with Bun but running into an issue. I don't have errors using bun until i add the tailwind astro integration

$ bunx --bun astro dev
✔ Console Ninja extension is connected to Astro, see https://tinyurl.com/2vt8jxzw
Unexpected reading "/Users/am/Coding/repro/astro-tailwind-console-ninja-bug/node_modules/postcss-load-config/src/options.js"

This file doesn't actually exist when I look for it.

I'm noticing that bun installs a bunch of node module packages (not sure if this is expected)

❯ cd node_modules
❯ ls
@alloc                                            hast-util-to-text                                 pirates
@ampproject                                       hast-util-whitespace                              pkg-dir
@astrojs                                          hastscript                                        postcss
@babel                                            html-escaper                                      postcss-import
@emmetio                                          html-void-elements                                postcss-js
@emnapi                                           http-cache-semantics                              postcss-load-config
@esbuild                                          human-signals                                     postcss-nested
@img                                              import-meta-resolve                               postcss-selector-parser
@isaacs                                           is-arrayish                                       postcss-value-parser
@jridgewell                                       is-binary-path                                    preferred-pm
@nodelib                                          is-buffer                                         prismjs
@pkgjs                                            is-core-module                                    prompts
@rollup                                           is-docker                                         property-information
@shikijs                                          is-extendable                                     queue-microtask
@types                                            is-extglob                                        read-cache
@ungap                                            is-fullwidth-code-point                           readdirp
@volar                                            is-glob                                           rehype
@vscode                                           is-inside-container                               rehype-parse
acorn                                             is-interactive                                    rehype-raw
ansi-align                                        is-number                                         rehype-stringify
ansi-regex                                        is-plain-obj                                      remark-gfm
ansi-styles                                       is-stream                                         remark-parse
any-promise                                       is-unicode-supported                              remark-rehype
anymatch                                          is-wsl                                            remark-smartypants
arg                                               isexe                                             remark-stringify
argparse                                          jackspeak                                         request-light
aria-query                                        jiti                                              require-directory
array-iterate                                     js-tokens                                         resolve
astro                                             js-yaml                                           restore-cursor
autoprefixer                                      jsesc                                             retext
axobject-query                                    json5                                             retext-latin
bail                                              jsonc-parser                                      retext-smartypants
balanced-match                                    kind-of                                           retext-stringify
base-64                                           kleur                                             reusify
binary-extensions                                 lilconfig                                         rollup
boxen                                             lines-and-columns                                 run-parallel
brace-expansion                                   load-yaml-file                                    section-matter
braces                                            locate-path                                       semver
browserslist                                      log-symbols                                       sharp
camelcase                                         longest-streak                                    shebang-command
camelcase-css                                     lru-cache                                         shebang-regex
caniuse-lite                                      magic-string                                      shiki
ccount                                            markdown-table                                    signal-exit
chalk                                             mdast-util-definitions                            simple-swizzle
character-entities                                mdast-util-find-and-replace                       sisteransi
character-entities-html4                          mdast-util-from-markdown                          source-map-js
character-entities-legacy                         mdast-util-gfm                                    space-separated-tokens
chokidar                                          mdast-util-gfm-autolink-literal                   sprintf-js
ci-info                                           mdast-util-gfm-footnote                           stdin-discarder
cli-boxes                                         mdast-util-gfm-strikethrough                      string-width
cli-cursor                                        mdast-util-gfm-table                              stringify-entities
cli-spinners                                      mdast-util-gfm-task-list-item                     strip-ansi
cliui                                             mdast-util-phrasing                               strip-bom
clsx                                              mdast-util-to-hast                                strip-bom-string
color                                             mdast-util-to-markdown                            strip-final-newline
color-convert                                     mdast-util-to-string                              sucrase
color-name                                        merge-stream                                      supports-color
color-string                                      merge2                                            supports-preserve-symlinks-flag
comma-separated-tokens                            micromark                                         tailwindcss
commander                                         micromark-core-commonmark                         thenify
common-ancestor-path                              micromark-extension-gfm                           thenify-all
convert-source-map                                micromark-extension-gfm-autolink-literal          to-fast-properties
cookie                                            micromark-extension-gfm-footnote                  to-regex-range
cross-spawn                                       micromark-extension-gfm-strikethrough             trim-lines
cssesc                                            micromark-extension-gfm-table                     trough
debug                                             micromark-extension-gfm-tagfilter                 ts-interface-checker
decode-named-character-reference                  micromark-extension-gfm-task-list-item            tsconfck
dequal                                            micromark-factory-destination                     tslib
detect-libc                                       micromark-factory-label                           type-fest
deterministic-object-hash                         micromark-factory-space                           typesafe-path
devalue                                           micromark-factory-title                           typescript
devlop                                            micromark-factory-whitespace                      typescript-auto-import-cache
didyoumean                                        micromark-util-character                          unherit
diff                                              micromark-util-chunked                            unified
dlv                                               micromark-util-classify-character                 unist-util-find-after
dset                                              micromark-util-combine-extensions                 unist-util-is
eastasianwidth                                    micromark-util-decode-numeric-character-reference unist-util-modify-children
electron-to-chromium                              micromark-util-decode-string                      unist-util-position
emmet                                             micromark-util-encode                             unist-util-remove-position
emoji-regex                                       micromark-util-html-tag-name                      unist-util-stringify-position
entities                                          micromark-util-normalize-identifier               unist-util-visit
es-module-lexer                                   micromark-util-resolve-all                        unist-util-visit-children
esbuild                                           micromark-util-sanitize-uri                       unist-util-visit-parents
escalade                                          micromark-util-subtokenize                        update-browserslist-db
escape-string-regexp                              micromark-util-symbol                             util-deprecate
esprima                                           micromark-util-types                              vfile
estree-walker                                     micromatch                                        vfile-location
eventemitter3                                     mimic-fn                                          vfile-message
execa                                             minimatch                                         vite
extend                                            minipass                                          vitefu
extend-shallow                                    mrmime                                            volar-service-css
fast-glob                                         ms                                                volar-service-emmet
fastq                                             muggle-string                                     volar-service-html
fill-range                                        mz                                                volar-service-prettier
find-up                                           nanoid                                            volar-service-typescript
find-yarn-workspace-root2                         nlcst-to-string                                   volar-service-typescript-twoslash-queries
flattie                                           node-releases                                     vscode-css-languageservice
foreground-child                                  normalize-path                                    vscode-html-languageservice
fraction.js                                       normalize-range                                   vscode-jsonrpc
fsevents                                          npm-run-path                                      vscode-languageserver
function-bind                                     object-assign                                     vscode-languageserver-protocol
gensync                                           object-hash                                       vscode-languageserver-textdocument
get-caller-file                                   onetime                                           vscode-languageserver-types
get-east-asian-width                              ora                                               vscode-nls
get-stream                                        p-limit                                           vscode-uri
github-slugger                                    p-locate                                          web-namespaces
glob                                              p-queue                                           which
glob-parent                                       p-timeout                                         which-pm
globals                                           p-try                                             which-pm-runs
graceful-fs                                       parse-latin                                       widest-line
gray-matter                                       parse5                                            wrap-ansi
has-flag                                          path-browserify                                   y18n
hasown                                            path-exists                                       yallist
hast-util-from-html                               path-key                                          yaml
hast-util-from-parse5                             path-parse                                        yargs
hast-util-is-element                              path-scurry                                       yargs-parser
hast-util-parse-selector                          path-to-regexp                                    yocto-queue
hast-util-raw                                     picocolors                                        zod
hast-util-to-html                                 picomatch                                         zod-to-json-schema
hast-util-to-parse5                               pify                                              zwitch

With pnpm this works fine. I can start the dev server and node modules looks like

❯ cd node_modules
❯ ls
@astrojs               astro                  tailwindcss            typescript             volar-service-prettier

So not sure what's going on here

What's the expected result?

Should work

Link to Minimal Reproducible Example

https://github.com/austinm911/astro-tailwind-console-ninja-bug

Participation

ematipico commented 6 months ago

Do you experience the same issue with Node.js?

austinm911 commented 6 months ago

Do you experience the same issue with Node.js?

Here's what I get

❯ bun astro dev
$ astro dev
ENOENT: no such file or directory, read
  Stack trace:
    at Object.readFileSync (node:fs:457:20)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at Object.<anonymous> (/Users/am/Coding/repro/astro-tailwind-console-ninja-bug/node_modules/postcss-load-config/src/index.js:9:21)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
error: script "astro" exited with code 1
bluwy commented 6 months ago

Bun issues should be reported to the Bun repo if it works in nodejs or npm (package manager).