Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Shiming stopped working #198

Closed
tomitrescak opened this issue Feb 17, 2017 · 3 comments
Closed

Shiming stopped working #198

tomitrescak opened this issue Feb 17, 2017 · 3 comments
Labels
Milestone

Comments

@tomitrescak
Copy link
Contributor

tomitrescak commented Feb 17, 2017

Hi, when I add any shim into my config I receive following error:

TypeError: Cannot read property 'acceptFiles' of undefined
    at BundleSource.addFile (/Users/tomi/Github/packages/webpack2-typescript/node_modules/fuse-box/dist/commonjs/BundleSource.js:47:71)
    at files.forEach.f (/Users/tomi/Github/packages/webpack2-typescript/node_modules/fuse-box/dist/commonjs/CollectionSource.js:17:37)
    at Array.forEach (native)
    at resolveFiles.then.files (/Users/tomi/Github/packages/webpack2-typescript/node_modules/fuse-box/dist/commonjs/CollectionSource.js:16:19)

Here is my config (when I remove the shim, error disappears). I run this with gulp louis;

gulp.task("louis-ui", ['copy-louis-html'], () => {
    fsbx.FuseBox.init({
        homeDir: "src",
        log: false,
        sourceMap: {
            bundleReference: 'louis.js.map',
            outFile: `${devReactFolder}/louis.js.map`
        },
        shim: {
            "crypto": {
                exports: "{ randomBytes: () => crypto.getRandomValues(new global.Uint16Array(1))[0] }"
            }
        },
        plugins: [
            typescriptTransform,
            fsbx.JSONPlugin(),
            fsbx.TypeScriptHelpers(), [
                fsbx.CSSResourcePlugin({
                    resolve: (f) => `/resources/${f}`
                }),
                fsbx.CSSPlugin()
            ],
        ],
        outFile: `${devReactFolder}/louis.js`,
    }).devServer("> client/modules/_stories/index.tsx", {
        httpServer: false,
        port: 5678
    });
});

gulp.task('louis-server', function () {
    if (node) node.kill()

    node = spawn('node', ['src/client/modules/_stories/server.js'], {
        stdio: 'inherit'
    })
    node.on('close', function (code) {
        if (code === 8) {
            gulp.log('Error detected, waiting for changes...');
        }
    });
});

gulp.task("copy-louis-html", () => {
    gulp.src("src/client/modules/_stories/louis.html")
        .pipe(gulp.dest(devReactFolder))
});

gulp.task('louis', ['louis-ui'], function () {
    runSequence(['louis-server']);
});
@nchanged
Copy link
Contributor

Oops, roger that will fix it and cover

@nchanged
Copy link
Contributor

Incredibly sorry for that one to slip through. We need more tests, I will move milestones and release the fix with tests very soon.

@nchanged nchanged added the bug label Feb 17, 2017
@nchanged nchanged added this to the 1.3.117 milestone Feb 17, 2017
@tomitrescak
Copy link
Contributor Author

Hey, don't worry about it. You guys created a piece of software that already made several of my days ;) Have already converted all my project to it ;)

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

No branches or pull requests

2 participants