keystonejs / keystone-test-project Goto Github PK
View Code? Open in Web Editor NEW⚠️ Archived - Legacy KeystoneJS Project with various configurations for development and testing purposes
License: MIT License
⚠️ Archived - Legacy KeystoneJS Project with various configurations for development and testing purposes
License: MIT License
I cloned the keystone-test-project repo, and when I npm start
it, I can go on localhost:3000, but a click on "Got it, let's begin" throws a 500 error:
GET / 304 20.493 ms
GET /js/application.js 304 0.317 ms
GET /keystone/ 302 0.505 ms
Error thrown for request: /keystone/signin
TypeError: Cannot read property 'id' of undefined
at SigninRoute (D:\DEV\WORKSPACE\keystone-test-project\node_modules\keystone\admin\server\routes\signin.js:17:16)
at Layer.handle [as handle_request] (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\layer.js:95:5)
at next (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\route.js:131:13)
at Route.dispatch (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\layer.js:95:5)
at D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\index.js:277:22
at Function.process_params (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\index.js:330:12)
at next (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\index.js:271:10)
at next (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\route.js:121:14)
at exports.persist (D:\DEV\WORKSPACE\keystone-test-project\node_modules\keystone\lib\session.js:210:3)
at Layer.handle [as handle_request] (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\layer.js:95:5)
at next (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\route.js:131:13)
at Route.dispatch (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\layer.js:95:5)
at D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\index.js:277:22
at param (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\index.js:349:14)
GET /keystone/signin 500 0.651 ms
The error is thown by this line: https://github.com/keystonejs/keystone/blob/master/admin/server/routes/signin.js#L17
Per the conversation with @JedWatson on Slack (#dev):
To get the new keystonejs/keystone-storage-adapter-s3 that @josephg contributed integrated into keystone-test-project:
In keystone-test-project:
keystone-storage-adapter-s3
dependency using the git url to the test project’s package.json
Files
list and add a field that uses itIn keystonejs/keystone:
admin/client/utils/List.js
and remove both instances of /legacy
(this will switch you over to the new api)I can take this task on if nobody else is working on it...
Following the "Complete Getting Started Guide" detailed at keystonejs/keystone#1612, I receive an error when starting the test project. Mongod is running and otherwise working.
$ KEYSTONE_DEV=true npm start
> [email protected] start /Users/nifl/Projects/Web/keystone-sites/keystone-test-project
> node keystone.js
------------------------------------------------
Mongo Error:
{ [MongoError: getaddrinfo ENOTFOUND undefined undefined:27017]
name: 'MongoError',
message: 'getaddrinfo ENOTFOUND undefined undefined:27017' }
Error: KeystoneJS (Keystone Test) failed to start - Check that you are running `mongod` in a separate process.
at NativeConnection.<anonymous> (/Users/nifl/Projects/Web/keystone-sites/keystone/lib/core/openDatabaseConnection.js:48:10)
at emitOne (events.js:77:13)
at NativeConnection.emit (events.js:169:7)
at NativeConnection.Connection.error (/Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongoose/lib/connection.js:425:8)
at /Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongoose/lib/connection.js:452:14
at /Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:52:21
at /Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongodb/lib/db.js:226:14
at null.<anonymous> (/Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongodb/lib/server.js:233:9)
at g (events.js:260:16)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at null.<anonymous> (/Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongodb-core/lib/topologies/server.js:263:68)
at g (events.js:260:16)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at null.<anonymous> (/Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongodb-core/lib/connection/pool.js:77:12)
at g (events.js:260:16)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at Socket.<anonymous> (/Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongodb-core/lib/connection/connection.js:121:49)
at Socket.g (events.js:260:16)
at emitOne (events.js:77:13)
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node keystone.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node keystone.js'.
npm ERR! This is most likely a problem with the keystone-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node keystone.js
npm ERR! You can get their info via:
npm ERR! npm owner ls keystone-test
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/nifl/Projects/Web/keystone-sites/keystone-test-project/npm-debug.log
$ mongod
2015-11-02T22:48:52.399-0800 I JOURNAL [initandlisten] journal dir=/data/db/journal
2015-11-02T22:48:52.400-0800 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
2015-11-02T22:48:52.414-0800 I JOURNAL [durability] Durability thread started
2015-11-02T22:48:52.414-0800 I CONTROL [initandlisten] MongoDB starting : pid=33631 port=27017 dbpath=/data/db 64-bit host=Forge.local
2015-11-02T22:48:52.414-0800 I CONTROL [initandlisten] db version v3.0.7
2015-11-02T22:48:52.414-0800 I JOURNAL [journal writer] Journal writer thread started
2015-11-02T22:48:52.414-0800 I CONTROL [initandlisten] git version: nogitversion
2015-11-02T22:48:52.414-0800 I CONTROL [initandlisten] build info: Darwin elcapitanvm.local 15.0.0 Darwin Kernel Version 15.0.0: Wed Aug 26 16:57:32 PDT 2015; root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2015-11-02T22:48:52.414-0800 I CONTROL [initandlisten] allocator: system
2015-11-02T22:48:52.414-0800 I CONTROL [initandlisten] options: {}
2015-11-02T22:48:52.444-0800 I NETWORK [initandlisten] waiting for connections on port 27017
On Line 31 of test/api-react/file/1-File.js
you make a call to an API endpoint, expecting a json value in return:
api.post('/keystone/api/files/create', {
body: formData,
responseType: 'json',
}
That snippet returns the following error:
xhr:79 Uncaught InvalidStateError: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'json').
However (in the name of science), if you change
responseType: 'json'
to
responseType: 'text'
then it simply returns the HTML of the login Page, which means the API calls in the test files aren't recognized as authenticated API calls?:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width">
<title>Sign in to Keystone Test</title>
<link rel="stylesheet" href="/keystone/styles/keystone.min.css">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
</head>
<body>
<div id="signin-view"></div>
<script>
var Keystone = {"adminPath":"/keystone","brand":"Keystone Test","csrf":{"header":{"x-csrf-token":"o4mFfdnfU9598c28ae972136be40ed9d7a489d66b1959eab0d"}},"from":"/keystone/api/files/create","userCanAccessKeystone":false};
</script>
<script src="/keystone/js/packages.js"></script>
<script src="/keystone/js/signin.js"></script>
</body>
</html>
I am having a problem testing out the new FS Storage Adapter. You can recreate the problem by taking the following steps:
Using keystone-test-project, update models/Post.js
to use the FS Adapter:
var storage = new keystone.Storage({
adapter: keystone.Storage.Adapters.FS,
fs: {
path: keystone.expandPath('./uploads'),
publicPath: '/public/uploads/',
},
...
});
Post.add({
...
image: { type: Types.File, storage: storage },
...
});
Launch the keystone-test-project with node keystone
Browse to the Post
section of the CMS, create a new Post and upload a photo.
Save that Post (The flash message should report that the save was successful).
Now browse back to the Post listing page: http://localhost:3000/keystone/posts
Click to open the Post you just saved.
Confirm that the Image you uploaded to the Post is not listed, nor is it saved in the uploads
folder
ReferenceError: keystone is not defined when i try to test project
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.