Visitar URL original
stackbit CLI doesn't properly escape pathnames on Windows. · Issue #5 · stackbit/stackbit-cli · GitHub
Skip to content

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

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.

Activity

  1. changed the title [-]stackbit CLI doesn't work on Windows 11 with node 18.[/-] [+]stackbit CLI doesn't properly escape pathnames on Windows.[/+] on Jun 2, 2023
  2. smnh commented on Jun 4, 2023

    @smnh
    Contributor

    Hi @pjmlp,
    Which version of Stackbit CLI are you using?
    stackbit --version

    This repo includes the old version of the CLI, the new version is currently hosted by a different repository that is currently private but will be publically available soon.

    Try to install the new version of the CLI by running npm -i g @stackbit/cli@latest.

  3. pjmlp commented on Jun 5, 2023

    @pjmlp
    Author

    We are using version 0.3.15 and trying to install the latest has hardly changed anything.

    PS C:\Projects\upathname> npm -i g @stackbit/cli@latest
    undefined
    PS C:\Projects\upathname> stackbit --version
    0.3.15
    
  4. smnh commented on Jun 8, 2023

    @smnh
    Contributor

    Thanks,
    We have identified the issue, and prioritized the fix. It will be fixed in one of the upcomming CLI versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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