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

04369be error TS1501: This regular expression flag is only available when targeting 'es2018' or later. #716

Open
4 tasks done
darktohka opened this issue Jul 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@darktohka
Copy link

Steps to reproduce

  1. Clone https://github.com/FreeTubeApp/FreeTube
  2. Install youtubei.js from git:
    "youtubei.js": "git+https://github.com/LuanRT/YouTube.js.git"
  3. Run yarn to install new version of youtubei.js

Failure Logs

$ npm run build

> [email protected] build
> npm run clean && npm run build:parser-map && npm run build:proto && npm run build:esm && npm run bundle:node && npm run bundle:browser && npm run bundle:browser:prod && npm run bundle:cf-worker && npm run bundle:react-native


> [email protected] clean
> npx rimraf ./dist/src ./dist/package.json ./bundle/browser.js ./bundle/browser.js.map ./bundle/browser.min.js ./bundle/browser.min.js.map ./bundle/node.cjs ./bundle/node.cjs.map ./bundle/cf-worker.js ./bundle/cf-worker.js.map ./bundle/react-native.js ./bundle/react-native.js.map ./deno


> [email protected] build:parser-map
> node ./dev-scripts/gen-parser-map.mjs


> [email protected] build:proto
> npx pb-gen-ts --entry-path="src/proto" --out-dir="src/proto/generated" --ext-in-import=".js"


> [email protected] build:esm
> npx tspc

src/core/Player.ts:224:185 - error TS1501: This regular expression flag is only available when targeting 'es2018' or later.

224     const match = data.match(/b=(?:a\.split\(|String\.prototype\.split\.call\(a,)\n?(?:""|\("",""\))\).*?\}return (?:b\.join\(|Array\.prototype\.join\.call\(b,)\n?(?:""|\("",""\))\)\}/s);
                                                                                                                                                                                            ~


Found 1 error in src/core/Player.ts:224

Expected behavior

The esm build succeeds.

Current behavior

The esm build fails.

Version

Default

Anything else?

Suggest changing tsconfig.json to target es2018

Change that broke build: 04369be

Checklist

  • I am running the latest version.
  • I checked the documentation and found no answer.
  • I have searched the existing issues and made sure this is not a duplicate.
  • I have provided sufficient information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant