Tools: ๐Ÿ› [email protected] breaks rome init

Created on 9 Aug 2020  ยท  7Comments  ยท  Source: rome/tools


Environment

$ rome rage --summary
Environment Variables
  Object {
    COLORTERM: "truecolor"
    LANG: "en_US.UTF-8"
    PATH: "/tmp/yarn--1596925617580-0.4856772163598271:/home/aanar/Development/Javascript/projects/Userlike/apps/umf/node_modules/.bin:/home/aanar/.config/yarn/link/node_modules/.bin:/home/aanar/.yarn/bin:/ni
    x/store/95s0smphr83sqnzjs8czyfvk7kyg505i-nodejs-14.5.0/libexec/lib/node_modules/npm/bin/node-gyp-bin:/nix/store/95s0smphr83sqnzjs8czyfvk7kyg505i-nodejs-14.5.0/lib/node_modules/npm/bin/node-gyp-bin:/nix/st
    ore/95s0smphr83sqnzjs8czyfvk7kyg505i-nodejs-14.5.0/bin/node_modules/npm/bin/node-gyp-bin:/nix/store/7azp14fh9dy5jfbhl5c2fk1gd1hkd7ja-patchelf-0.9/bin:/nix/store/1v0410l20p343l6cvpijz8bi4if2ysh6-gcc-wrappe
    r-9.2.0/bin:/nix/store/pbfnvqlf8bgp09gy601554ph83y4qzp5-gcc-9.2.0/bin:/nix/store/v235kcs9jfd5vw9d1ylwilqvf49dyjhg-glibc-2.30-bin/bin:/nix/store/bgvd279hrb53i3ah2mi0nf8jp6g6g6g9-coreutils-8.31/bin:/nix/sto
    re/sh8l6la5mv29girlgswnd23s0vfpcfdn-binutils-wrapper-2.31.1/bin:/nix/store/nyhj00w339gk2gaj3faz70gjrnbmam8v-binutils-2.31.1/bin:/nix/store/v235kcs9jfd5vw9d1ylwilqvf49dyjhg-glibc-2.30-bin/bin:/nix/store/bg
    vd279hrb53i3ah2mi0nf8jp6g6g6g9-coreutils-8.31/bin:/nix/store/95s0smphr83sqnzjs8czyfvk7kyg505i-nodejs-14.5.0/bin:/nix/store/xpp01rrs8y7fsq44dvf6fldkb4lz40w6-yarn-1.22.4/bin:/nix/store/l0pb7caslb4d99ydcmpnc
    hzkpl0lzd0j-python-2.7.17/bin:/nix/store/6y6vknih3bisq77famdy0y322ych1gna-vscode-with-extensions-1.44.1/bin:/nix/store/bgvd279hrb53i3ah2mi0nf8jp6g6g6g9-coreutils-8.31/bin:/nix/store/1rhis3wsl2jbd78c6yy4cq
    sb4xk0lb43-findutils-4.7.0/bin:/nix/store/18wym0gzky4svbv9afyx4nl7kr297n3q-diffutils-3.7/bin:/nix/store/ymk93mnzr0d6qafpr19rngrkzmslm8lg-gnused-4.8/bin:/nix/store/sjvvyjp67sssnpl0k0g5ysmcm8xscwp4-gnugrep-
    3.4/bin:/nix/store/5c1damhkybvqliiccxn510iy8sck5304-gawk-5.0.1/bin:/nix/store/2b4c17l8b5kml3kh9q4jb8zclc2gwafs-gnutar-1.32/bin:/nix/store/rkbz618nhks3x8rb2pzbrrqp4bzlhdy5-gzip-1.10/bin:/nix/store/xhrb919k
    3pfx8ldbg3mky8cfbkipsgb8-bzip2-1.0.6.0.1-bin/bin:/nix/store/83r0d1ifwprxhkzzryrcy07hx4bmpxiq-gnumake-4.2.1/bin:/nix/store/9si14qjcz8072c0v42zbkglq08s2cg04-bash-4.4-p23/bin:/nix/store/6wv4ba40i9scmwqzylh4c
    mlfak9zqckn-patch-2.7.6/bin:/nix/store/hsa8hmhkpkagfx1j9pbhsgfr2z4y2z5b-xz-5.2.4-bin/bin:/nix/store/aqh6028s0khqxsk6szvkkjx5yx8ijl2v-kitty-0.16.0/bin:/nix/store/g2zqyqswg2hj81zkds8s69jryb7xbha3-imagemagic
    k-6.9.10-71/bin:/nix/store/yijmpdah58frahpvg3ngw768ibj7iz1z-xsel-unstable-2019-08-21/bin:/nix/store/f7bjg7imqrnfvm13yp5fd3m4iv491lqv-ncurses-6.1-20190112-dev/bin:/run/wrappers/bin:/home/aanar/.nix-profile
    /bin:/etc/profiles/per-user/aanar/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"
    TERM: "xterm-kitty"
    USER: "aanar"
  }

User Config
  unset

Rome Version
  10.0.3-beta

Node Version
  14.5.0

Platform
  linux x64 5.4.33

Terminal Features
  Object {
    background: "unknown"
    colorDepth: 24
    columns: 212
    cursor: true
    hyperlinks: true
    isTTY: true
    unicode: true
  }

Client Flags
  Object {
    clientName: "cli"
    cwd: "/home/aanar/Development/Javascript/projects/Userlike/apps/umf"
    realCwd: "/home/aanar/Development/Javascript/projects/Userlike/apps/umf"
    silent: false
  }

Server Status
  Object {
    projects: Array [
      Object {id: 0}
      Object {id: 1}
    ]
    server: Object {
      heapTotal: 27_394_048
      pid: 16_608
      uptime: 0.184674525
    }
    workers: Array [
      Object {
        astCacheSize: 0
        heapTotal: 27_394_048
        ownedBytes: 0
        ownedFileCount: 0
        pid: 16_608
        uptime: 0.184605815
      }
    ]
  }

Steps To Reproduce


  1. Try rome init with a project that has [email protected] installed.

Expected Results

???


This is actually a funny issue. It seems before/during publish, polished accidentally added a file with the name ~.
rome tries to do something with that file, but expands ~ to my home directory path /home/aanar.

See:

 project-rome/@internal/core/server/fs/MemoryFileSystem.ts:552:22 internalError/fs  INTERNAL  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

  โœ– /home/aanar/Development/Javascript/projects/Userlike/apps/umf/node_modules/polished/home/aanar does not exist

   2. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.hardStat (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:552:22)
   3. hardStat (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:758:28)
   4. Function.from
   5. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addDirectory (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:777:26)
   6. runNextTicks (internal/process/task_queues.js:58:4)
   7. process.processTimers (internal/timers.js:491:8)
   8. declareItem (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:762:4)
   9. Function.all
  10. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addDirectory (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:777:2)
  11. declareItem (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:762:4)
  12. Function.all
  13. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addDirectory (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:777:2)
  14. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.createWatcher (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:297:3)
  15. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.watch (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:537:23)
  16. ___R$project$rome$$internal$core$server$project$ProjectManager_ts$default.findProject (project-rome/@internal/core/server/project/ProjectManager.ts:891:5)
  17. Object.callback (project-rome/@internal/core/server/commands/init.ts:86:26)
  18. ___R$project$rome$$internal$core$server$Server_ts$default.dispatchRequest (project-rome/@internal/core/server/Server.ts:924:4)
  19. ___R$project$rome$$internal$core$server$Server_ts$default.handleRequest (project-rome/@internal/core/server/Server.ts:781:46)
  20. <anonymous> (project-rome/@internal/core/server/Server.ts:599:10)
  21. Function.all
  and 1 others...
confirmed

Most helpful comment

This is actually a different issue. The other is from package.json exports parsing whereas this is memory file system construction.

All 7 comments

Confirmed this issue. Seems to be produced by a file in /node_modules/polished/\~, if you delete it you can successfully run rome init. At least that worked for me. I'm going to dive deeper to see if I can see why this is happening.

I think Rome just doesn't like the fact its got ~ as the filename.

These LOCs appears to be the issue.
https://github.com/romefrontend/rome/blob/765e91ccc1b27eff59a6205e64e23b0df66db0f3/internal/path/index.ts#L757-L761

When it comes across ~ it explodes the home directory resulting in the incorrect path being constructed. Simply commenting out that condition fixes the issue and doesn't break any test cases, but thats probably not something we want to do. Not exactly sure how to proceed with this @sebmck.

This is a duplicate of https://github.com/romefrontend/rome/issues/991

We might want close this one, I guess

Yeah this is a duplicate, closing.

This is actually a different issue. The other is from package.json exports parsing whereas this is memory file system construction.

1027 will fix this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yoshixmk picture yoshixmk  ยท  4Comments

sebmck picture sebmck  ยท  5Comments

shirshak55 picture shirshak55  ยท  3Comments

yamadayuki picture yamadayuki  ยท  3Comments

sebmck picture sebmck  ยท  3Comments