regenerator.mark is not a function svelte + rollup + babel

Viewed 274

I am getting the error Uncaught TypeError: regenerator.mark is not a function

I checked bundle generated regenerator is { __esModule: true }

seems @babel/plugin-transform-runtime, it's not able to inject runtime.js in a bundle.

here's Rollup config:-

export default {
input: 'src/main.js',
output: {
    sourcemap: true,
    format: 'iife',
    name: 'app',
    file: `public/build/${bundleName}`,
},
plugins: [
    svelte({
        compilerOptions: {
            // enable run-time checks when not in production
            dev: !production,
        },
        preprocess: preprocess(),
    }),

    babel({
        extensions: ['.js', '.mjs', '.html', '.svelte'],
        runtimeHelpers: true,
        exclude: 'node_modules/core-js/**',
        presets: [
            [
                '@babel/preset-env',
                {
                    // debug: true,
                    useBuiltIns: 'entry',
                    corejs: '3',
                    targets: {
                        browsers: ['safari >= 5', 'ie >= 11', 'not dead'],
                    },
                },
            ],
        ],
        plugins: [
            '@babel/plugin-syntax-dynamic-import',
            [
                '@babel/plugin-transform-runtime',
                {
                    useESModules: false,
                },
            ],
        ],
    }),

    resolve({
        browser: true,
        dedupe: ['svelte'],
    }),
    commonjs(),
    includePaths(includePathOptions),

    production && terser(),
    production && gzipPlugin(),
],
};
0 Answers
Related