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

SyntaxError when running build script #545

Open
natebuckareff opened this issue Nov 30, 2024 · 0 comments
Open

SyntaxError when running build script #545

natebuckareff opened this issue Nov 30, 2024 · 0 comments

Comments

@natebuckareff
Copy link
Contributor

Running the following on a fresh clone:

pnpm install
pnpm build 18.0.0

Gives the error:


> [email protected] build /tmp/readable-stream
> node build/build.mjs "18.0.0"

[INFO] Downloading https://nodejs.org/dist/v18.0.0/node-v18.0.0.tar.gz ...
[INFO] Extracting Node.js 18.0.0 tar file ...
[INFO] extraction done
[INFO] Creating directory lib ...
[INFO] Creating directory lib/stream ...
[INFO] Creating directory lib/internal ...
[INFO] Creating directory lib/internal/streams ...
[INFO] Creating directory test/common ...
[INFO] Creating directory test/parallel ...
[INFO] Creating directory test/fixtures ...
[INFO] Creating directory lib/ours ...
[INFO] Creating directory test/ours ...
[INFO] Creating directory test/browser ...
[INFO] Creating directory test/browser/fixtures ...
[INFO] Creating file lib/_stream_transform.js (replacements, babel, prettier) ...
[INFO] Creating file lib/_stream_duplex.js (replacements, babel, prettier) ...
[INFO] Creating file lib/stream/promises.js (replacements, babel, prettier) ...
[INFO] Creating file lib/internal/validators.js (replacements, babel, prettier) ...
[INFO] Creating file lib/internal/streams/add-abort-signal.js (replacements, babel, prettier) ...
/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:359
    const error = new SyntaxError();
                  ^

SyntaxError: unknown: Expecting Unicode escape sequence \uXXXX. (21:8)

  19 |   validateObject,
  20 | } = require('../validators');
> 21 | require\('../event_target'\);const kWeakHandler = require('../../ours/primordials').Symbol('kWeak');
     |         ^
  22 | const { finished } = require('./end-of-stream');
  23 |
  24 | const {
    at constructor (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:359:19)
    at Parser.raise (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:3266:19)
    at Parser.readWord1 (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:3226:16)
    at Parser.readWord (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:3246:23)
    at Parser.getTokenFromCode (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:2969:16)
    at Parser.nextToken (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:2449:10)
    at Parser.next (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:2362:10)
    at Parser.eat (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:2366:12)
    at Parser.isLineTerminator (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:3588:17)
    at Parser.semicolon (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:3591:25)
    at Parser.parseVarStatement (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:12725:10)
    at Parser.parseStatementContent (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:12340:23)
    at Parser.parseStatementLike (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:12257:17)
    at Parser.parseModuleItem (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:12234:17)
    at Parser.parseBlockOrModuleBlockBody (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:12810:36)
    at Parser.parseBlockBody (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:12803:10)
    at Parser.parseProgram (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:12131:10)
    at Parser.parseTopLevel (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:12121:25)
    at Parser.parse (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:13929:10)
    at parse (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:13963:38)
    at parser (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/core/lib/parser/index.js:41:34)
    at parser.next (<anonymous>)
    at normalizeFile (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/core/lib/transformation/normalize-file.js:64:37)
    at normalizeFile.next (<anonymous>)
    at run (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/core/lib/transformation/index.js:22:50)
    at run.next (<anonymous>)
    at transform (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/core/lib/transform.js:22:33)
    at transform.next (<anonymous>)
    at evaluateSync (/tmp/readable-stream/node_modules/.pnpm/[email protected]/node_modules/gensync/index.js:251:28)
    at sync (/tmp/readable-stream/node_modules/.pnpm/[email protected]/node_modules/gensync/index.js:89:14)
    at stopHiding - secret - don't use this - v1 (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js:47:12)
    at transform (/tmp/readable-stream/node_modules/.pnpm/@[email protected]/node_modules/@babel/core/lib/transform.js:36:80)
    at processFiles (file:///tmp/readable-stream/build/build.mjs:129:39)
    at async main (file:///tmp/readable-stream/build/build.mjs:227:3)
    at async file:///tmp/readable-stream/build/build.mjs:230:1 {
  code: 'BABEL_PARSE_ERROR',
  reasonCode: 'MissingUnicodeEscape',
  loc: Position { line: 21, column: 8, index: 370 },
  pos: 370,
  syntaxPlugin: undefined
}

Node.js v20.13.1
 ELIFECYCLE  Command failed with exit code 1.

Looks like the problem is a typoed \\ in build/replacements.mjs:internalStreamsWeakHandler. PR with fix here: #544

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

1 participant