microsoft / vscode-l10n

MIT License
64 stars 12 forks source link

Weird treesitter crash with v0.0.29, not on v0.0.16 #127

Closed RigoLigoRLC closed 1 year ago

RigoLigoRLC commented 1 year ago

Cannot generate l10n files on my computer with this crash:

(base) PS D:\prj\vscext\pepb-helper> npx @vscode/l10n-dev export -o ./l10n ./src
Need to install the following packages:
  @vscode/l10n-dev@0.0.29
Ok to proceed? (y)
Searching for TypeScript/JavaScript files...
Found 5 TypeScript files. Extracting strings...
vscode-l10n-dev export [args] <path..>

Export strings from source files. Supports glob patterns.

位置:
  path  TypeScript files to extract strings from. Supports folders and glob
        patterns.                                     [数组] [必需] [默认值: []]

选项:
      --version  显示版本号                                               [布尔]
  -v, --verbose  Enable verbose logging                                   [布尔]
  -d, --debug    Enable debug logging                                     [布尔]
      --help     显示帮助信息                                             [布尔]
  -o, --outDir   Output directory                                       [字符串]

Error: bad export type for `tree_sitter_tsx_external_scanner_create`: undefined
    at reportUndefinedSymbols (C:\Users\RigoLigo\AppData\Local\npm-cache\_npx\68546583dcb2c24b\node_modules\web-tree-sitter\tree-sitter.js:1:19748)
    at postInstantiation (C:\Users\RigoLigo\AppData\Local\npm-cache\_npx\68546583dcb2c24b\node_modules\web-tree-sitter\tree-sitter.js:1:17027)
    at C:\Users\RigoLigo\AppData\Local\npm-cache\_npx\68546583dcb2c24b\node_modules\web-tree-sitter\tree-sitter.js:1:17752
    at async C:\Users\RigoLigo\AppData\Local\npm-cache\_npx\68546583dcb2c24b\node_modules\@vscode\l10n-dev\dist\cli.js:334:10

Rolling back to v0.0.16 will work:

(base) PS D:\prj\vscext\pepb-helper> npm uninstall @vscode/l10n-dev

added 33 packages, changed 1 package, and audited 231 packages in 3s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities
(base) PS D:\prj\vscext\pepb-helper> cnpm install @vscode/l10n-dev@v0.0.16
√ Linked 11 latest versions fallback to D:\prj\vscext\pepb-helper\node_modules\.store\node_modules
√ Installed 1 packages on D:\prj\vscext\pepb-helper
√ All packages installed (5 packages installed from npm registry, used 737ms(network 734ms), speed 29.31KB/s, json 0(0B), tarball 21.51KB, manifests cache hit 11, etag hit 10 / miss 0)

dependencies:
+ @vscode/l10n-dev ^0.0.16

(base) PS D:\prj\vscext\pepb-helper> npx @vscode/l10n-dev export -o ./l10n ./src
Searching for TypeScript files...
Found 5 TypeScript files. Extracting strings...
Writing exported strings to: D:\prj\vscext\pepb-helper\l10n\bundle.l10n.json
TylerLeonhardt commented 1 year ago

This is a duplicate of https://github.com/microsoft/vscode-l10n/issues/114 and the workaround is to use an older version of node for now.