Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

minimal reproduction of the error: rollup.defineConfig is not a function

License

Notifications You must be signed in to change notification settings

tasshi-playground/repro-rollup-defineConfig-undefined

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archived

The issue was closed in rollup/rollup#4134

repro-rollup-defineConfig-undefined

minimal reproduction of rollup/rollup#4133 .

[!] TypeError: rollup.defineConfig is not a function

Summary

rollup -c failed when rollup.config.js using rollup.defineConfig, because rollup.defineConfig is not defined at runtime.

FYI: rollup.defineConfig is added in v2.51.0.

Reproduction

$ git clone https://github.com/tasshi-playground/repro-rollup-defineConfig-undefined.git
$ cd repro-rollup-defineConfig-undefined
$ npm install
$ npm run build # equal to "rollup -c"

Then, error occur.

Expected Behavior

rollup -c success with rollup.config.js using rollup.defineConfig.

Actual Behavior

rollup -c failed with following error.

[!] TypeError: rollup.defineConfig is not a function
TypeError: rollup.defineConfig is not a function
    at Object.<anonymous> (<project_dir>/rollup.config.js:7:28)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.require.extensions.<computed> [as .js] (<project_dir>/node_modules/rollup/dist/shared/loadConfigFile.js:530:20)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at loadConfigFromBundledFile (<project_dir>/node_modules/rollup/dist/shared/loadConfigFile.js:538:42)
    at getDefaultFromTranspiledConfigFile (<project_dir>/node_modules/rollup/dist/shared/loadConfigFile.js:522:12)
    at async loadConfigFile (<project_dir>/rollup/dist/shared/loadConfigFile.js:487:15)

Cause

rollup.defineConfig is defined in type definition but does not exist at runtime.

with Node.js REPL, rollup module does not contain defineConfig.

Welcome to Node.js v14.17.0.
Type ".help" for more information.
> require("rollup")
{
  VERSION: '2.51.0',
  rollup: [Function: rollup],
  watch: [Function: watch]
}

Lisence

This project is licensed under the MIT license.

About

minimal reproduction of the error: rollup.defineConfig is not a function

Resources

License

Stars

Watchers

Forks