rollup / rollup/rollup

Rollup does not include imported code in the bundle.

Open
#4,883 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

t¹ 🐞 bug t⁸ ⋅ triage
Dominant language
JavaScript
Stars
26.3k
Forks
1.8k
Avg merge
2d 11h
Merged PRs (30d)
20

Description

Rollup Version

3.17.3

Operating System (or Browser)

Linux

Node Version (if applicable)

v18.13.0

Link To Reproduction

https://stackblitz.com/edit/rollup-repro-afbkru?file=package.json,rollup.config.js,src%2Fmain.js

Expected Behaviour

The output bundle should contain code based on the code that is installed. buffer is clearly available, inside node_modules (see the file system in the reproduction).

~/projects/rollup-repro-afbkru
❯ ls node_modules/buffer/
AUTHORS.md    README.md     index.js      
LICENSE       index.d.ts    package.json 
Actual Behaviour

It ignores the valid code, does not produce a bundle containing that code, and tells people to go try and install something else:

(!) Missing shims for Node.js built-ins
Creating a browser bundle that depends on "buffer". You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node

Use "output.globals" to specify browser global variable names corresponding to external modules:
buffer (guessing "buffer")

Rollup should not block the import of buffer, which is valid code and is present in node_modules.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction, reading package.json, rollup.config.js, and src/main.js together. Run the reported Rollup 3.17.3 build on Node 18 and compare the generated bundle and warning with the expected behavior. Done means the reproduction's imported buffer code is handled according to the issue's stated expectation, with a regression test or documented limitation if applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.