Tools: ๐Ÿ› Path normalization can normalize away all segments

Created on 13 Aug 2020  ยท  6Comments  ยท  Source: rome/tools


Environment

Environment Variables
  Object {
    COLORFGBG: "15;0"
    COLORTERM: "truecolor"
    LANG: "en_US.UTF-8"
    TERM: "xterm-256color"
    TERM_PROGRAM: "iTerm.app"
  }

User Config
  unset

Rome Version
  10.0.4-beta

Node Version
  12.12.0

Platform
  darwin x64 19.5.0

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

Client Flags
  Object {
    clientName: "cli"
    cwd: "/Users/pholley/projects/photog-admin"
    realCwd: "/Users/pholley/projects/photog-admin"
    silent: false
  }

Server Status
  Object {
    projects: Array [
      Object {id: 0}
      Object {id: 1}
    ]
    server: Object {
      heapTotal: 25_755_648
      pid: 58_705
      uptime: 0.173907903
    }
    workers: Array [
      Object {
        astCacheSize: 0
        heapTotal: 25_755_648
        ownedBytes: 0
        ownedFileCount: 0
        pid: 58_705
        uptime: 0.173859949
      }
    ]
  }


Steps To Reproduce

./node_modules/.bin/rome check client

 project-rome/@internal/path/index.ts:823:8 internalError/request  INTERNAL  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

  โœ– Segments were normalized to an empty array. Original: ["file:..",".."]

  12. ___R$$priv$project$rome$$internal$path$index_ts$parsePathSegments (project-rome/@internal/path/index.ts:823:8)
  13. ___R$project$rome$$internal$path$index_ts$createUnknownFilePath (project-rome/@internal/path/index.ts:932:16)
  14. ___R$project$rome$$internal$codec$js$manifest$dependencies_ts$parseDependencyPattern (project-rome/@internal/codec-js-manifest/dependencies.ts:469:2)
  15. ___R$project$rome$$internal$codec$js$manifest$dependencies_ts$normalizeDependencies (project-rome/@internal/codec-js-manifest/dependencies.ts:515:16)
  16. ___R$project$rome$$internal$codec$js$manifest$index_ts$normalizeManifest (project-rome/@internal/codec-js-manifest/index.ts:678:19)
  17. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.declareManifestWithPossibleDiagnosticsThrow (
      project-rome/@internal/core/server/fs/MemoryFileSystem.ts:656:12)
  18. ___R$project$rome$$internal$diagnostics$wrap_ts$catchDiagnostics (project-rome/@internal/diagnostics/wrap.ts:29:16)
  19. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.declareManifest (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:627:24)
  20. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addFile (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:926:3)
  21. declareItem (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:760:4)
  22. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addDirectory (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:771:5)
  23. declareItem (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:762:4)
  24. Function.all
  25. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addDirectory (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:777:2)
  26. declareItem (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:762:4)
  27. Function.all
  28. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addDirectory (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:777:2)
  29. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.createWatcher (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:297:3)
  30. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.watch (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:537:23)
  31. ___R$project$rome$$internal$core$server$project$ProjectManager_ts$default.findProject (project-rome/@internal/core/server/project/ProjectManager.ts:891:5)
  and 11 others...

  โš  This diagnostic was derived from an internal Rome error. Potential bug, please report if necessary.
unconfirmed

Most helpful comment

We haven't done a release in a couple of weeks, I'll try and have one out today as it will fix a ton of issues like this.

All 6 comments

had a similar issue in #990 (10.0.3-beta) now seeing this after #1027 (10.0.4-beta)

node version14.4.0

This might have been fixed earlier, but should be gone for good with #1086. I want to confirm though, since ../.. should never be normalized away.

Ran into this issue on 10.0.4-beta node version v12.18.3 after running rome init on existing project

 Welcome to Rome! Let's get you started... 

[1/2] Generating .editorconfig

 project-rome/@internal/path/index.ts:823:8 internalError/request  INTERNAL  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

  โœ– Segments were normalized to an empty array. Original: ["file:..",".."]

  10. ___R$$priv$project$rome$$internal$path$index_ts$parsePathSegments (project-rome/@internal/path/index.ts:823:8)
  11. ___R$project$rome$$internal$path$index_ts$createUnknownFilePath (project-rome/@internal/path/index.ts:932:16)
  12. ___R$project$rome$$internal$codec$js$manifest$dependencies_ts$parseDependencyPattern (
      project-rome/@internal/codec-js-manifest/dependencies.ts:469:2)
  13. ___R$project$rome$$internal$codec$js$manifest$dependencies_ts$normalizeDependencies (
      project-rome/@internal/codec-js-manifest/dependencies.ts:515:16)
  14. ___R$project$rome$$internal$codec$js$manifest$index_ts$normalizeManifest (
      project-rome/@internal/codec-js-manifest/index.ts:678:19)
  15. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.
      declareManifestWithPossibleDiagnosticsThrow (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:656:12)
  16. ___R$project$rome$$internal$diagnostics$wrap_ts$catchDiagnostics (
      project-rome/@internal/diagnostics/wrap.ts:29:16)
  17. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.declareManifest (
      project-rome/@internal/core/server/fs/MemoryFileSystem.ts:627:24)
  18. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addFile (
      project-rome/@internal/core/server/fs/MemoryFileSystem.ts:926:3)
  19. declareItem (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:760:4)
  20. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addDirectory (
      project-rome/@internal/core/server/fs/MemoryFileSystem.ts:771:5)
  21. declareItem (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:762:4)
  22. Function.all
  23. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addDirectory (
      project-rome/@internal/core/server/fs/MemoryFileSystem.ts:777:2)
  24. declareItem (project-rome/@internal/core/server/fs/MemoryFileSystem.ts:762:4)
  25. Function.all
  26. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.addDirectory (
      project-rome/@internal/core/server/fs/MemoryFileSystem.ts:777:2)
  27. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.createWatcher (
      project-rome/@internal/core/server/fs/MemoryFileSystem.ts:297:3)
  28. ___R$project$rome$$internal$core$server$fs$MemoryFileSystem_ts$default.watch (
      project-rome/@internal/core/server/fs/MemoryFileSystem.ts:537:23)
  29. ___R$project$rome$$internal$core$server$project$ProjectManager_ts$default.findProject (
      project-rome/@internal/core/server/project/ProjectManager.ts:891:5)
  and 9 others...

We haven't done a release in a couple of weeks, I'll try and have one out today as it will fix a ton of issues like this.

@sebmck Any update on cutting a release? I'm also running into this issue!

Hey! Not at the moment, sorry ๐Ÿ˜ข I have had restricted time to work on Rome but it will stabilize in a couple of weeks. If another core contributor who is reading this is interested in cutting a release and writing a changelog then I can defer it to them and add the relevant permissions.

Was this page helpful?
0 / 5 - 0 ratings