Giter Site home page Giter Site logo

egg-serlina's People

Contributors

djyde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

shadowkun

egg-serlina's Issues

Invalid webpack config

I got this error when I use egg-serlina :

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration[1].entry should be one of these:
   object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function
   -> The entry point(s) of the compilation.
   Details:
    * configuration[1].entry should not be empty.
      -> Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
    * configuration[1].entry should be a string.
      -> An entry point without name. The string is resolved to a module which is loaded upon startup.
    * configuration[1].entry should be an array:
      [non-empty string]
    * configuration[1].entry should be an instance of function
      -> A Function returning an entry object, an entry string, an entry array or a promise to these things.
 - configuration[1].entry should be one of these:
   object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function
   -> The entry point(s) of the compilation.
   Details:
    * configuration[1].entry should not be empty.
      -> Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
    * configuration[1].entry should be a string.
      -> An entry point without name. The string is resolved to a module which is loaded upon startup.
    * configuration[1].entry should be an array:
      [non-empty string]
    * configuration[1].entry should be an instance of function
      -> A Function returning an entry object, an entry string, an entry array or a promise to these things.

It seems caused by this line of code:

            const compiler = webpack([clientSide, serverSide, vendors]);

The serverSide's entry is an empty object

reference error: React is not defined

Hi,

I am getting the following error when running the egg-server. I have followed the exact steps mentioned in the readme.

Error Stack

yarn run v1.9.4
$ egg-bin dev
2018-08-22 14:21:02,457 INFO 14452 [master] node version v10.0.0
2018-08-22 14:21:02,457 INFO 14452 [master] egg version 2.10.0
2018-08-22 14:21:06,442 INFO 14452 [master] agent_worker#1:11420 started (3985ms)
2018-08-22 14:21:20,772 WARN 17680 [egg:core:ready_timeout] 10 seconds later C:\Users\######\node_modules\egg-watcher\app.js:15:7 was still unable to finish.
 DONE  Compiled successfully in 4000ms14:21:24

 DONE  Compiled successfully in 4235ms14:21:24

2018-08-22 14:21:24,897 INFO 14452 [master] egg started on http://127.0.0.1:7001 (22440ms)
 DONE  Compiled successfully in 7470ms14:21:28

2018-08-22 14:21:38,791 ERROR 17680 [-/127.0.0.1/-/32ms GET /home] nodejs.ReferenceError: React is not defined
    at exports.default (webpack:///./page/home.js?:8:5)
    at processChild (C:\Users\######\node_modules\react-dom\cjs\react-dom-server.node.development.js:2138:14)
    at resolve (C:\Users\######\node_modules\react-dom\cjs\react-dom-server.node.development.js:2064:5)
    at ReactDOMServerRenderer.render (C:\Users\######\node_modules\react-dom\cjs\react-dom-server.node.development.js:2383:22)
    at ReactDOMServerRenderer.read (C:\Users\######\node_modules\react-dom\cjs\react-dom-server.node.development.js:2357:19)
    at Object.renderToString (C:\Users\######\node_modules\react-dom\cjs\react-dom-server.node.development.js:2729:25)
    at Serlina.<anonymous> (C:\Users\######\node_modules\serlina\dist\serlina.js:200:41)
    at Generator.next (<anonymous>)
    at C:\Users\######\node_modules\serlina\dist\serlina.js:7:71
    at new Promise (C:\Users\######\node_modules\core-js\modules\es6.promise.js:177:7)

pid: 123456
hostname: ######

Relevant Files

// config.default.js
'use strict';

module.exports = appInfo => {
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_xxxxxxxxxxxxxxx';

  // add your config here
  config.middleware = [];
  
  config.serlina = {
    map: {
      '/home': 'home'
    }
  };
  
  return config;
};
// plugin.js
exports.serlina = {
    enable: true,
    package: 'egg-serlina',
};
// package.json
"dependencies": {
    "egg": "^2.2.1",
    "egg-scripts": "^2.5.0",
    "egg-serlina": "^0.1.2",
    "react": "^16.4.2",
    "react-dom": "^16.4.2"
  }

Folder Structure

- root-dir
  - app
  - client
    - page
       - home.js

Content of home.js

export default () => {
    return <div>Hello Serlina</div>
}

Could you let me know what i might be doing wrong ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.