-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
SyntaxError: Invalid Unicode escape sequence #18824
Comments
I have the same issue. @MiiZZo Did you find a solution to fix this? |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
This PR fixes an issue where our `withNx` function for Next.js is compiled with inlined `workspaceRoot` (to support container environments). On Windows, we write the `.nx-helpers/with-nx.js` with the following: ```js workspaceRoot: 'C:\Users\user\projects\app', ``` The `\u` character result in a Node error: `Invalid Unicode escape sequence`. The fix is to escape `\` as `\\`, so when the file is written, the path is valid and does not cause unicode errors. <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #18824
This PR fixes an issue where our `withNx` function for Next.js is compiled with inlined `workspaceRoot` (to support container environments). On Windows, we write the `.nx-helpers/with-nx.js` with the following: ```js workspaceRoot: 'C:\Users\user\projects\app', ``` The `\u` character result in a Node error: `Invalid Unicode escape sequence`. The fix is to escape `\` as `\\`, so when the file is written, the path is valid and does not cause unicode errors. <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #18824 (cherry picked from commit 4ab9e6d)
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Get this error when run
pnpm nx run web:serve --prod
C:\Users\user\Documents\projects\app\dist\packages\web.nx-helpers\with-nx.js:19
workspaceRoot: 'C:\Users\user\Documents\projects\app',
^^^^^^
There are no errors if I replace all
\
with/
manually in workspaceRoot.Expected Behavior
No errors
GitHub Repo
https://github.com/MiiZZo/rsc-posts-app
Steps to Reproduce
nx run web:serve --prod
Nx Report
Failure Logs
No response
Package Manager Version
[email protected] or [email protected]
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: