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

'inherits' is not exported by node_modules/util/util.js #393

Closed
srepollock opened this issue Jun 5, 2019 · 2 comments
Closed

'inherits' is not exported by node_modules/util/util.js #393

srepollock opened this issue Jun 5, 2019 · 2 comments

Comments

@srepollock
Copy link

Running into an error with Inherits not being exported by node_modules/util/util.js.

Rollup Config

import typescript from 'rollup-plugin-typescript2';
import babel from 'rollup-plugin-babel';
import globals from 'rollup-plugin-node-globals';
import builtins from 'rollup-plugin-node-builtins';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from "rollup-plugin-commonjs";
import pkg from "./package.json";

export default {
    input: './src/index.ts',
    plugins: [
        typescript(),
        resolve({
            preferBuiltins: true,
            browser: true
        }),
        commonjs({
            include: "node_modules/*",
        }),
        builtins(),
        globals({
            process: true,
            global: true,
            dirname: true,
            filename: true
        }),
        babel(),
    ],
    output: [ // Required; Array = multiple outputs
        {
            file: pkg.main,
            format: 'umd',
            name: 'Divine'
        },
        {
            file: "lib/divine.cjs.js",
            format: 'cjs'
        },
        {
            file: pkg.module,
            format: 'es'
        }
    ],
    watch: {
        include: [
            "src/**/*.ts"
        ],
        exclude: [
            
        ]
    }
}

I have used the following fixes to no avail:

  1. Reordered plugin support
  2. Updated commonjs to the following:
        commonjs({
            include: "node_modules/*",
            namedExports: {
                "node_modules/util/util.js": ['inherits']
            }
        }),

Has anyone else seen a similar issue? I can't seem to find more on the web at this time.
Thank you for all the help in advance!

@bterlson
Copy link
Contributor

This could be related to #394. You can try downgrading resolve to 1.11.0 and see if it helps.

@srepollock
Copy link
Author

That did solve the issue. thanks @bterlson

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants