Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error "Could not resolve entry (<module>)" when using manualChunks #2248

Closed
reinaldoarrosi opened this issue Jun 6, 2018 · 5 comments
Closed

Comments

@reinaldoarrosi
Copy link

Given a simple application that uses react, when using

manualChunks: {
    'vendor': ['react']
}

Rollup gives "Could not resolve entry (react)".

This is also reported (including sample code reproducing the issue) here #2084 (comment)

@guybedford
Copy link
Contributor

guybedford commented Jun 6, 2018 via email

@reinaldoarrosi
Copy link
Author

I'm already using rollup-plugin-node-resolve.

In fact, if I simply remove the manualChunks option, my project builds fine and the correct chunks are generated (see example rollup.config.js below).

import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';

export default [
    {
        experimentalCodeSplitting: true,
        input: [
            './index.jsx', 
            './page1.jsx'
        ],
        output: {
            dir: './dist',
            format: 'system'
        },
        // manualChunks: {
        //     'vendor': ['react']
        // },
        plugins: [
            resolve({ extensions: ['.jsx', '.js'] }),
            commonjs(),
            babel({ exclude: 'node_modules/**' })
        ]
    }
];

Also, the same error occurs when using the following rollup.config.js (Using 'react' as 'input' as you suggested for testing):

import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';

export default [
    {
        input: 'react',
        output: {
            file: './dist/bundle.js',
            format: 'system',
        },
        plugins: [
            resolve(),
            commonjs(),
            babel({ exclude: 'node_modules/**' })
        ]
    }
];

@guybedford
Copy link
Contributor

Ah, this might be a bug in rollup-plugin-node-resolve if it's not supporting the input: 'react' case...

@reinaldoarrosi
Copy link
Author

Should I open the issue there?

@guybedford
Copy link
Contributor

It seems like that would be the place for it, yes.

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

No branches or pull requests

2 participants