Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Shows how to fix reserved keyword 'package' bundling error in flutterwave-node-v3. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

For "SyntaxError: The keyword 'package' is reserved": 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.

SyntaxError: The keyword 'package' is reserved

Steps

  1. 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.
  2. 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.

When to use

You are seeing this: The new package no longer declares variables named package, so commonjs bundling completes without the reserved-keyword error. Use this skill when you run into "Fix reserved keyword 'package' bundling error in flutterwave-node-v3".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

Bundling flutterwave-node-v3 with rollup fails with a SyntaxError because the package used JavaScript reserved words like package as variable names.

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 2 · 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>

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