8000 Could not load module, "ENOENT: no such file or directory" · Issue #64 · rollup/rollup-watch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 20, 2019. It is now read-only.

Could not load module, "ENOENT: no such file or directory" #64

Open
kevinfiol opened this issue Sep 26, 2018 · 1 comment
Open

Could not load module, "ENOENT: no such file or directory" #64

kevinfiol opened this issue Sep 26, 2018 · 1 comment

Comments

@kevinfiol
Copy link

Receiving this error while trying to use nanoid, on Rollup version 0.63.4.

[!] Error: Could not load crypto (imported by C:\.dev\js\profiles\node_modules\nanoid\random.js): ENOENT: no such file or directory, open 'crypto'

Loading the JS in the browser shows this error in the console:

TypeError: random is not a function

I tried using rollup-plugin-node-builtins, and while the rollup error went away, the console error in the browser remains.

My index.js:

import nanoid from 'nanoid';

const a = nanoid(11);
console.log(a);

My rollup.config.js:

const config = {
    input: './src/index.js',
    output: {
        file: './public/app.js',
        format: 'iife',
        sourcemap: true
    },
    plugins: [
        nodeResolve(),
        commonjs(),
        buble(),
    ],
};

export default config;
@ycjcl868
Copy link
ycjcl868 commented Oct 6, 2018

me too

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
0