Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Webpack config (React/Redux) seems inherently fragile #507

@jonorogers

Description

@jonorogers

When using the provided webpack config from the React/Redux template it seems to be fragile - breaking as soon as extra modules are installed.

The worst example I've run into is using openlayers and firebase. They break in different ways.

Adding firebase (npm install --save firebase) and a couple of statements to load up firebase will start generating webpack errors which aren't present if including this from a basic react-webpack template.

import * as firebase from 'firebase';

        let firebaseConfig = {
            apiKey: "",
            authDomain: "",
            databaseURL: "",
            storageBucket: "",
            messagingSenderId: ""
        };

        // Initialize Firebase - once for the app
        firebase.initializeApp(firebaseConfig);

Then adding openlayers (npm install --save openlayers) immediately breaks webpack - generating a huge amount of errors reading json files - like there's no json loader present.

ERROR in ./~/tough-cookie/package.json Module parse failed: C:\code\yo-asp-net-core-spa-react-redux\node_modules\tough-cookie\package.json Unexpected token (2:9) You may need an appropriate loader to handle this file type. SyntaxError: Unexpected token (2:9)

There's lots more like that; all about peer packages.

I've seen this symptom (lots of errors about .json files) before, but I can't remember the exact modules which caused the issue.

Have tested this combination with react-webpack yo template with no problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions