Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pjmlp opened this issue Jun 2, 2023 · 3 comments
Open

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

pjmlp opened this issue Jun 2, 2023 · 3 comments

Comments

@pjmlp
Copy link

pjmlp commented Jun 2, 2023

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.

@pjmlp pjmlp changed the title stackbit CLI doesn't work on Windows 11 with node 18. stackbit CLI doesn't properly escape pathnames on Windows. Jun 2, 2023
@smnh
Copy link
Member

smnh commented Jun 4, 2023

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.

@pjmlp
Copy link
Author

pjmlp commented Jun 5, 2023

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

@smnh
Copy link
Member

smnh commented Jun 8, 2023

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants