Skip to content

stackbit CLI doesn't properly escape pathnames on Windows. #5

@pjmlp

Description

@pjmlp

I keep trying to start stackbit cli with no avail.

Keep getting the following error

C:\Projects\company\proj-name\.stackbit\cache\stackbit.config.CPGVOGMS.cjs:1
function stackbit_process_cwd_shim() { return "C:\Projects\company\proj-name" }
                                                          ^^^^^^

SyntaxError: Invalid Unicode escape sequence
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1176:20)
    at Module._compile (node:internal/modules/cjs/loader:1218:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at importFresh (C:\Users\username\AppData\Roaming\npm\node_modules\@stackbit\cli\node_modules\@stackbit\sdk\dist\config\config-loader-esbuild.js:132:20)
    at getConfigFromResult (C:\Users\username\AppData\Roaming\npm\node_modules\@stackbit\cli\node_modules\@stackbit\sdk\dist\config\config-loader-esbuild.js:143:25)

This kind of error can also be replicated with Stackbit tutorials, for example with the ts-nextjs starter project.

The root cause seems to be if there is a directory name starting with the u letter, then it is assumed to be an unicode constant, thus the error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions