Skip to content

Conversation

@f-f
Copy link
Member

@f-f f-f commented Jan 25, 2026

Fix #1348 - we now properly escape paths when writing the Node script for spago run/spago test.

While writing tests for this I noticed that we were not properly sanitising folder names to use as package names when running spago init, so I bundled that in here since it's a related fix.

@thomashoneyman
Copy link
Member

Test failure for windows:

✓ Build succeeded.

Running tests for package: docs-search-index
node:internal/url:827
      href = bindingUrl.parse(input, base, true);
                        ^
TypeError: Invalid URL
    at new URL (node:internal/url:827:25)
    at fileURLToPath (node:internal/url:1608:12)
    at defaultResolve (node:internal/modules/esm/resolve:995:21)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:731:20)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:310:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:182:49) {
  code: 'ERR_INVALID_URL',
  input: 'file://D%3A/a/spago/spago/output/Test.Docs.Search.Main/index.js'
}

Node.js v22.22.0

@f-f
Copy link
Member Author

f-f commented Jan 25, 2026

Right, it's always Windows 😄 I have added a fix for that and added a set of unit tests for the new path encoding logic

@thomashoneyman
Copy link
Member

Now it’s Ubuntu!

@f-f
Copy link
Member Author

f-f commented Jan 27, 2026

@thomashoneyman good for a look now 🙂

@f-f f-f merged commit 1d4c9aa into master Jan 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drive Paths with special characters fail on "spago test"

3 participants