dom-testing-library icon indicating copy to clipboard operation
dom-testing-library copied to clipboard

Fix 'TypeError: _browserslist.findConfigFile is not a function'

Open nifgraup opened this issue 10 months ago • 3 comments

What:

I remove browserslist override which was causing errors on: npm run setup -s

Why:

Have to build.

How:

removed pin in package.json

Checklist:

  • N/A [ ] Documentation added to the docs site
  • N/A [ ] Tests
  • N/A [ ] TypeScript definitions updated
  • [ x] Ready to be merged

nifgraup avatar Jan 15 '25 17:01 nifgraup

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 31b37f4843bf0992c0e7307cc7203b1dc214bb09:

Sandbox Source
react-testing-library-examples Configuration

codesandbox-ci[bot] avatar Jan 15 '25 17:01 codesandbox-ci[bot]

Have you checked why we added this? It used to ensure we always target the same syntax level. Changing it randomly on publish is unsafe since we might produce syntax that's only valid for newer Node.js/Browser versions i.e. a breaking change.

eps1lon avatar Jan 15 '25 17:01 eps1lon

It was originally added in #1169 to avoid parsing error by Acorn < 7.3.0 (the Acorn JS parser is used by Webpack). Since then Node.js 12 has been dropped #1207 which similarly does not support Nullish coalescing like Acorn < 7.3.0.

I myself do similar thing as the reporter in #1169, use webpack to bundle the tests and run them in a browser. That webpack configuration sets the target of browsers to run the tests in.

Is webpack 4 (Acorn 6) within the support matrix?

nifgraup avatar Jan 15 '25 17:01 nifgraup