https://github.com/cachecontrol/esm-config-tostring-bug
https://github.com/cachecontrol/esm-config-tostring-bug
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cachecontrol/esm-config-tostring-bug
- Owner: CacheControl
- Created: 2018-03-21T18:44:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-20T00:53:43.000Z (over 7 years ago)
- Last Synced: 2025-06-25T07:45:46.446Z (6 months ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# esm config toString
## Behavior
Running an esm based application that has an esm based package w/a `config` package as a dependency, an error is thrown.
- problem occurs when importing a package using `esm` and `config`, into an application also using `esm`
- occurs when both app and package are on 3.0.20
```bash
⇒ npm run start
> esm-app3@1.0.0 start /Users/chamm/esm-nyc-bug/esm-app
> node -r esm index.js
/Users/chamm/esm-nyc-bug/esm-package/node_modules/config/lib/config.js:1
TypeError: Function.prototype.toString requires that 'this' be a Function
at Proxy.toString ()
at Function.keys ()
```
## Usage
```bash
# initialize the esm package
cd esm-package;
npm install;
npm link;
# initalize consuming app
cd esm-app
npm install;
npm link esm-package;
npm run start # throws error: Function.prototype.toString requires that 'this' be a Function
```