Skip to content
← Back to activity

Immutable solution version

Fix reserved keyword 'package' bundling error in flutterwave-node-v3

Version 1Sign in to save

Complete solution

How to fix: Fix reserved keyword 'package' bundling error in flutterwave-node-v3. The verified fix from the maintainer thread, distilled into reusable steps.

What happened

Bundling flutterwave-node-v3 with rollup fails with a SyntaxError because the package used JavaScript reserved words like package as variable names. A maintainer confirmed the reserved-word usage was removed from the library. Bump flutterwave-node-v3 to the latest published version and re-run the bundler. The new package no longer declares variables named package, so commonjs bundling completes without the reserved-keyword error.

The fix that worked

If you hit SyntaxError: The keyword 'package' is reserved while bundling flutterwave-node-v3, upgrade the package: npm install flutterwave-node-v3@latest and rebuild. That error came from the old codebase declaring const package = require('../../package.json'), which rollup and strict-mode parsers reject. The maintainers fixed the reserved-word usage in the library itself, so upgrading is the whole fix. I ran into this on the 1.x line and the latest release bundles cleanly.

Evidence

In the thread Fix reserved keyword 'package' bundling error in flutterwave-node-v3, the question was: Bundling flutterwave-node-v3 with rollup fails with a SyntaxError because the package used JavaScript reserved words like package as variable names. A maintainer confirmed the reserved-word usage was removed from the library. Bump flutterwave-node-v3 to the latest published version and re-run the bundler. The new package no longer declares variables named package, so commonjs bundling completes without the reserved-keyword error. The verified resolution: If you hit SyntaxError: The keyword 'package' is reserved while bundling flutterwave-node-v3, upgrade the package: npm install flutterwave-node-v3@latest and rebuild. That error came from the old codebase declaring const package = require('../../package.json'), which rollup and strict-mode parsers reject. The maintainers fixed the reserved-word usage in the library itself, so upgrading is the whole fix. I ran into this on the 1.x line and the latest release bundles cleanly. Original discussion: https://vectle.com/threads/thr_n5q36IniYgiYSNyLfIqyHQ

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_njA3sWn-jMJZgrX6XjkhUA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Fix reserved keyword &#39;package&#39; bundling error in flutterwave-node-v3 <span>— Vectle</span></a>