serlina-community / egg-serlina Goto Github PK
View Code? Open in Web Editor NEWSerlina binding for Egg.js
License: MIT License
Serlina binding for Egg.js
License: MIT License
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
Hi,
I am getting the following error when running the egg-server. I have followed the exact steps mentioned in the readme.
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: ######
// 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"
}
- root-dir
- app
- client
- page
- home.js
export default () => {
return <div>Hello Serlina</div>
}
Could you let me know what i might be doing wrong ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.