Skip to content
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

Routify app still has blocker to using bun --bun vite #3735

Closed
yus-ham opened this issue Jul 22, 2023 · 3 comments
Closed

Routify app still has blocker to using bun --bun vite #3735

yus-ham opened this issue Jul 22, 2023 · 3 comments
Labels
bug Something isn't working node.js Compatibility with Node.js APIs

Comments

@yus-ham
Copy link
Contributor

yus-ham commented Jul 22, 2023

What version of Bun is running?

0.7

What platform is your computer?

ubuntu 22.04

What steps can reproduce the bug?

bun --bun vite

What is the expected behavior?

After fix

image

What do you see instead?

here is my debug.

1. call to fs.lstatSync()

error: SystemError
 syscall: "TODO"
   errno: -254

      at /data/www/00-cup/bun-play/viteapp/node_modules/graceful-fs/polyfills.js:330:28
      at /data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/util/stat.js:28:13
      at getStatsSync (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/util/stat.js:34:14)
      at checkPathsSync (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/util/stat.js:81:32)
      at copySync (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/copy/copy-sync.js:27:32)
SystemError: 
    at lstatSync (native)
    at <anonymous> (/data/www/00-cup/bun-play/viteapp/node_modules/graceful-fs/polyfills.js:331:17)
    at <anonymous> (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/util/stat.js:27:48)
    at getStatsSync (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/util/stat.js:40:4)
    at checkPathsSync (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/util/stat.js:82:16)
    at copySync (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/copy/copy-sync.js:27:42)

fs-extra sets bigint: true option which seems not available in bun, set to undefined will fix the issue

/data/www/00-cup/bun-play/viteapp/node_modules/graceful-fs/polyfills.js#statFixSync {
  orig: [Function: lstatSync],
  target: "/data/www/00-cup/bun-play/viteapp/node_modules/@roxi/routify/lib/buildtime/plugins/filemapper/lib/utils/[...404].svelte",
  options: {
    bigint: true
  }
}

2. call to fs.chmodSync() -- Resolved by: #3747

TypeError: Invalid mode: must be an octal number
    at chmodSync (native)
    at <anonymous> (/data/www/00-cup/bun-play/viteapp/node_modules/graceful-fs/polyfills.js:269:8)
    at setDestMode (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/copy/copy-sync.js:102:35)
    at copyFile (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/copy/copy-sync.js:82:39)
    at onFile (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/copy/copy-sync.js:59:9)
    at getStats (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/copy/copy-sync.js:51:11)
    at handleFilterAndCopy (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/copy/copy-sync.js:35:43)
    at copySync (/data/www/00-cup/bun-play/viteapp/node_modules/fs-extra/lib/copy/copy-sync.js:28:54)

fs.stat() returns stat.mode which has integer type. set mode = mode.toString(8).slice(2) before fs.chmodSync() calls will fixs the issue, in example its converts 33188 to "0644"

/data/www/00-cup/bun-play/viteapp/node_modules/graceful-fs/polyfills.js#chmodFixSync {
  orig: [Function: chmodSync],
  target: ".routify/components/[...404].svelte",
  mode: 33188
}
@yus-ham yus-ham added the bug Something isn't working label Jul 22, 2023
@yus-ham
Copy link
Contributor Author

yus-ham commented Jul 22, 2023

chmodSync() issue may related with #3740

@robobun robobun added the node.js Compatibility with Node.js APIs label Jul 22, 2023
@paperdave
Copy link
Collaborator

lstatSync will be resolved by #4208

@yus-ham
Copy link
Contributor Author

yus-ham commented Aug 19, 2023

its worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node.js Compatibility with Node.js APIs
Projects
None yet
Development

No branches or pull requests

3 participants