模块构建失败:TypeError:fileSystem.statSync不是函数

时间:2018-12-07 11:07:11

标签: reactjs babel-loader

尝试运行reactjs应用程序,但出现此错误

  

模块构建失败:TypeError:fileSystem.statSync不是函数

我的package.json文件如下所示

{ "name": "stellar-laboratory", "version": "0.0.1", "private": true, "description": "", "author": "Stellar Development Foundation <stellar@stellar.org>", "license": "Apache-2.0", "scripts": { "start": "gulp develop", "build": "gulp build" }, "dependencies": { "@ledgerhq/hw-app-str": "^4.14.0", "@ledgerhq/hw-transport-u2f": "^4.13.0", "axios": "^0.8.1", "babel-loader": "^7.1.5", "babel-preset-stage-2": "^6.24.1", "babel-core": "^6.0.20", "babel-plugin-transform-runtime": "^6.23.0", "babel-polyfill": "^6.0.16", "babel-preset-es2015": "^6.24.1", "babel-preset-stage-0": "^6.0.15", "bluebird": "^3.5.1", "browser-sync": "^2.9.11", "chai": "^3.5.0", "classnames": "^2.2.0", "css-loader": "^0.18.0", "extract-text-webpack-plugin": "^0.8.2", "file-loader": "^0.8.4", "gulp": "^3.9.0", "gulp-mocha": "^2.2.0", "html-webpack-plugin": "^1.6.2", "json-loader": "^0.5.3", "lodash": "^4.17.5", "mocha": "^2.4.5", "node-sass": "^4.7.2", "react": "^0.14.0", "react-dom": "^0.14.0", "react-redux": "^4.0.0", "redux": "^3.0.4", "redux-thunk": "^1.0.0", "route-recognizer": "^0.1.9", "sass-loader": "^3.2.3", "solar-css": "git+https://github.com/stellar/solar#master", "solar-stellarorg": "git+https://github.com/stellar/solar-stellarorg#master", "stellar-sdk": "^0.11.0", "uri-templates": "^0.1.9", "urijs": "^1.16.0", "webpack": "^1.13.2" } }

更新

然后我将babel-loader1降级为7.1.1

**张贴到我收到此错误消息

  

模块构建失败:SyntaxError:意外令牌(42:2)

app.js

require("./styles/main.scss");

import React from 'react';
import ReactDOM from 'react-dom';
import {createStore, applyMiddleware} from 'redux';
import thunk from 'redux-thunk';
import {Provider} from 'react-redux';
import {throttle} from 'lodash';

import rootReducer from './reducers/root';
import logging from './middleware/logging';
import {routerMiddleware} from './utilities/simpleRouter';
import LaboratoryChrome from './components/LaboratoryChrome';
import {loadState, saveState}  from './localStorage';

const persistedState = loadState();

import StellarSdk from 'stellar-sdk';

if (typeof window !== "undefined") {
  window.StellarSdk = StellarSdk;
}

document.write('<div id="app"></div>');


let createStoreWithMiddleware = applyMiddleware(
  thunk,
  routerMiddleware,
  logging
)(createStore);

let store = createStoreWithMiddleware(rootReducer, persistedState);

store.subscribe(throttle(() => {
  saveState({
    network: store.getState().network
  });
}, 1000));

ReactDOM.render(
  <Provider store={store}>
    <LaboratoryChrome />
  </Provider>,
  document.getElementById('app')
);

1 个答案:

答案 0 :(得分:0)

仅使用纱线即可解决