Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

include exception identifier in catch blocks #25147

Merged
merged 2 commits into from
May 12, 2022
Merged

include exception identifier in catch blocks #25147

merged 2 commits into from
May 12, 2022

Conversation

wentokay
Copy link
Contributor

Problem

when the try/catch exception identifier is excluded, during the build phase, rollup is throwing the error

SyntaxError: Unexpected token in node_modules/@solana/web3.js/lib/index.browser.esm.js

Summary of Changes

change

try {} catch {}

to

try {} catch(_err) {}

when it's excluded, rollup throws the error

`SyntaxError: Unexpected token in node_modules/@solana/web3.js/lib/index.browser.esm.js`
@mergify mergify bot added the community Community contribution label May 11, 2022
@mergify mergify bot requested a review from a team May 11, 2022 20:26
@wentokay
Copy link
Contributor Author

wentokay commented May 11, 2022

minimal example extracted from an existing project here

https://github.com/wentokay/catch-example

& failing build logs

https://github.com/wentokay/catch-example/runs/6395757798?check_suite_focus=true

Run yarn build
  yarn build
  shell: /usr/bin/bash -e {0}
yarn run v1.[2](https://github.com/wentokay/catch-example/runs/6395757798?check_suite_focus=true#step:5:2)2.18
warning package.json: No license field
$ rollup -c

src/index.ts → dist/index.js...
[!] (plugin at position [3](https://github.com/wentokay/catch-example/runs/6395757798?check_suite_focus=true#step:5:3)) SyntaxError: Unexpected token (8[4](https://github.com/wentokay/catch-example/runs/6395757798?check_suite_focus=true#step:5:4)3[8](https://github.com/wentokay/catch-example/runs/6395757798?check_suite_focus=true#step:5:8):18) in /home/runner/work/catch-example/catch-example/node_modules/@solana/web3.js/lib/index.browser.esm.js

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants